Merge pull request #1375 from dgarske/ifm_feedback

Add support for `WOLFSSL_NO_MALLOC` with memory callbacks
This commit is contained in:
toddouska 2018-02-15 14:19:21 -08:00 committed by GitHub
commit cbd7612324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -101,7 +101,11 @@ void* wolfSSL_Malloc(size_t size)
#endif
}
else {
#ifndef WOLFSSL_NO_MALLOC
res = malloc(size);
#else
WOLFSSL_MSG("No malloc available");
#endif
}
#ifdef WOLFSSL_MALLOC_CHECK
@ -126,7 +130,11 @@ void wolfSSL_Free(void *ptr)
#endif
}
else {
#ifndef WOLFSSL_NO_MALLOC
free(ptr);
#else
WOLFSSL_MSG("No free available");
#endif
}
}
@ -146,7 +154,11 @@ void* wolfSSL_Realloc(void *ptr, size_t size)
#endif
}
else {
#ifndef WOLFSSL_NO_MALLOC
res = realloc(ptr, size);
#else
WOLFSSL_MSG("No realloc available");
#endif
}
return res;

View File

@ -53,8 +53,8 @@
/* lwIP needs to be configured to use sockets API in this mode */
/* LWIP_SOCKET 1 in lwip/opt.h or in build */
#include "lwip/sockets.h"
#include <errno.h>
#ifndef LWIP_PROVIDE_ERRNO
#include <errno.h>
#define LWIP_PROVIDE_ERRNO 1
#endif
#elif defined(FREESCALE_MQX)