add small sanity check to libsofia

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5194 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-05-16 21:05:22 +00:00
parent 007160d31a
commit a59cf9ee25
1 changed files with 6 additions and 5 deletions

View File

@ -929,7 +929,7 @@ int su_home_init(su_home_t *home)
return 0;
}
#define safe_free(it) if (it) { free(it); it = NULL; }
/** Internal deinitialization */
static
void _su_home_deinit(su_home_t *home)
@ -965,16 +965,17 @@ void _su_home_deinit(su_home_t *home)
}
else if (su_is_preloaded(b, b->sub_nodes[i].sua_data))
continue;
free(b->sub_nodes[i].sua_data);
safe_free(b->sub_nodes[i].sua_data);
}
}
if (b->sub_preload && !b->sub_preauto)
free(b->sub_preload);
safe_free(b->sub_preload);
if (b->sub_stats)
free(b->sub_stats);
safe_free(b->sub_stats);
if (!b->sub_auto)
free(b);
safe_free(b);
home->suh_blocks = NULL;