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>
pull/8425/head
Peter Züger 2022-03-16 15:45:03 +01:00 zatwierdzone przez Damien George
rodzic a16dcc8136
commit 95ee29f4f4
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

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