Set pointers to NULL after freeing them
Closed this issue · 0 comments
PauloMigAlmeida commented
something akin to
void saferFree(void **pp) {
if (pp != NULL && *pp != NULL) {
free(*pp);
*pp = NULL;
}
}
#define safeFree(p) saferFree((void**)&(p))