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
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;