Replace malloc with calloc
- platform layer currently broken (not adapted yet)
- memmory_buffer_alloc too
diff --git a/library/pkcs11.c b/library/pkcs11.c
index e2ad989..b3a3be6 100644
--- a/library/pkcs11.c
+++ b/library/pkcs11.c
@@ -36,7 +36,7 @@
#include "mbedtls/platform.h"
#else
#include <stdlib.h>
-#define mbedtls_malloc malloc
+#define mbedtls_calloc calloc
#define mbedtls_free free
#endif
@@ -64,7 +64,7 @@
goto cleanup;
}
- cert_blob = mbedtls_malloc( cert_blob_size );
+ cert_blob = mbedtls_calloc( 1, cert_blob_size );
if( NULL == cert_blob )
{
ret = 4;