mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-21 21:36:21 +01:00
Memory-allocation abstraction layer and buffer-based allocator added
This commit is contained in:
parent
f863485fea
commit
6e339b52e8
18 changed files with 818 additions and 103 deletions
|
|
@ -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 )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue