Skip to content
Snippets Groups Projects
Commit 82e1848f authored by deuce's avatar deuce
Browse files

Fix FREE_AND_NULL() so it can be used wherever a function is... especially:

if (fg)
	FREE_AND_NULL(fd);
else
	FREE_AND_NULL(bg);
parent eda5afb9
No related branches found
No related tags found
No related merge requests found
......@@ -486,7 +486,12 @@ typedef struct {
/********************************/
/* Handy Pointer-freeing Macros */
/********************************/
#define FREE_AND_NULL(x) if((x)!=NULL) { FREE(x); (x)=NULL; }
#define FREE_AND_NULL(x) do { \
if((x)!=NULL) { \
FREE(x); \
(x)=NULL; \
} \
} while(0)
#define FREE_LIST_ITEMS(list,i) if(list!=NULL) { \
for(i=0;list[i]!=NULL;i++) \
FREE_AND_NULL(list[i]); \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment