Contiki: Fix heapmem_free() warning

heapmem_free() warns if ptr is NULL.
This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2024-10-18 13:06:52 +01:00
1 parent 4803f161f0
commit c72a7b32a1
1 file changed
+2 -1
+2 -1
View File
@@ -654,7 +654,8 @@ coap_free_type(coap_memory_tag_t type, void *ptr) {
if (ptr)
track_counts[type]--;
#endif /* COAP_MEMORY_TYPE_TRACK */
heapmem_free(ptr);
if (ptr)
heapmem_free(ptr);
}
#endif /* WITH_CONTIKI */