stm32/mbedtls: Add NULL pointer check in m_free_mbedtls.
According to the C standard the free(void *ptr) function: if ptr is a null pointer, no action occurs. Signed-off-by: Peter Züger <zueger.peter@icloud.com>
This commit is contained in:
parent
a16dcc8136
commit
95ee29f4f4
@ -62,6 +62,9 @@ void *m_calloc_mbedtls(size_t nmemb, size_t size) {
|
||||
}
|
||||
|
||||
void m_free_mbedtls(void *ptr_in) {
|
||||
if (ptr_in == NULL) {
|
||||
return;
|
||||
}
|
||||
void **ptr = &((void**)ptr_in)[-2];
|
||||
#if DEBUG
|
||||
uint32_t nb;
|
||||
|
Loading…
x
Reference in New Issue
Block a user