1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Memory-allocation abstraction layer and buffer-based allocator added

This commit is contained in:
Paul Bakker
2013-07-03 13:37:05 +02:00
parent f863485fea
commit 6e339b52e8
18 changed files with 818 additions and 103 deletions

View File

@ -33,6 +33,13 @@
#include "polarssl/bignum.h"
#endif
#if defined(POLARSSL_MEMORY_C)
#include "polarssl/memory.h"
#else
#define polarssl_malloc malloc
#define polarssl_free free
#endif
#include <string.h>
#include <stdlib.h>
#include <time.h>
@ -238,7 +245,7 @@ int asn1_get_sequence_of( unsigned char **p,
/* Allocate and assign next pointer */
if (*p < end)
{
cur->next = (asn1_sequence *) malloc(
cur->next = (asn1_sequence *) polarssl_malloc(
sizeof( asn1_sequence ) );
if( cur->next == NULL )