Skip to content

Commit

Permalink
Contiki: Fix heapmem_free() warning
Browse files Browse the repository at this point in the history
heapmem_free() warns if ptr is NULL.
  • Loading branch information
mrdeep1 committed Oct 18, 2024
1 parent 4803f16 commit c72a7b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/coap_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit c72a7b3

Please sign in to comment.