Replace malloc with calloc
- platform layer currently broken (not adapted yet)
- memmory_buffer_alloc too
diff --git a/library/x509_csr.c b/library/x509_csr.c
index ebf8897..4347fbb 100644
--- a/library/x509_csr.c
+++ b/library/x509_csr.c
@@ -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 @@
/*
* 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 );