PauloMigAlmeida/aws-lambda-c-runtime

Set pointers to NULL after freeing them

Closed this issue · 0 comments

something akin to

void saferFree(void **pp) {    
   if (pp != NULL && *pp != NULL) { 
       free(*pp);        
      *pp = NULL;    
   }
}

#define safeFree(p) saferFree((void**)&(p))