Replace malloc with calloc
- platform layer currently broken (not adapted yet)
- memmory_buffer_alloc too
diff --git a/library/pkparse.c b/library/pkparse.c
index f8800f8..254a04d 100644
--- a/library/pkparse.c
+++ b/library/pkparse.c
@@ -57,7 +57,7 @@
#include "mbedtls/platform.h"
#else
#include <stdlib.h>
-#define mbedtls_malloc malloc
+#define mbedtls_calloc calloc
#define mbedtls_free free
#endif
@@ -93,7 +93,7 @@
*n = (size_t) size;
if( *n + 1 == 0 ||
- ( *buf = mbedtls_malloc( *n + 1 ) ) == NULL )
+ ( *buf = mbedtls_calloc( 1, *n + 1 ) ) == NULL )
{
fclose( f );
return( MBEDTLS_ERR_PK_MALLOC_FAILED );