Replace malloc with calloc

- platform layer currently broken (not adapted yet)
- memmory_buffer_alloc too
This commit is contained in:
Manuel Pégourié-Gonnard 2015-05-26 16:04:06 +02:00
parent 065122cfe9
commit 7551cb9ee9
31 changed files with 122 additions and 131 deletions

View file

@ -53,7 +53,7 @@
#include <stdlib.h>
#include <stdio.h>
#define mbedtls_free free
#define mbedtls_malloc malloc
#define mbedtls_calloc calloc
#define mbedtls_snprintf snprintf
#endif
@ -113,7 +113,7 @@ int mbedtls_x509_csr_parse_der( mbedtls_x509_csr *csr,
/*
* first copy the raw DER data
*/
p = mbedtls_malloc( len = buflen );
p = mbedtls_calloc( 1, len = buflen );
if( p == NULL )
return( MBEDTLS_ERR_X509_MALLOC_FAILED );