**Freeing NULL pointers

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
JoVM
Posts: 89
Joined: Thu Mar 12, 2015 12:13 pm

**Freeing NULL pointers

Post by JoVM »

Why chHeapFree() doesn't support freeing NULL pointers?

Code: Select all

chDbgCheck(p != NULL);


It is heavily supported in mbed TLS and my code has runtime failures. Is a wrapper required or else?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: **Freeing NULL pointers

Post by Giovanni »

It is considered an error, it has no meaning anyway. You may create a wrapper function if you need that.

Giovanni
Post Reply