mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-15 05:08:26 +00:00
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:
parent
007160d31a
commit
a59cf9ee25
@ -929,7 +929,7 @@ int su_home_init(su_home_t *home)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#define safe_free(it) if (it) { free(it); it = NULL; }
|
||||||
/** Internal deinitialization */
|
/** Internal deinitialization */
|
||||||
static
|
static
|
||||||
void _su_home_deinit(su_home_t *home)
|
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))
|
else if (su_is_preloaded(b, b->sub_nodes[i].sua_data))
|
||||||
continue;
|
continue;
|
||||||
free(b->sub_nodes[i].sua_data);
|
safe_free(b->sub_nodes[i].sua_data);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (b->sub_preload && !b->sub_preauto)
|
if (b->sub_preload && !b->sub_preauto)
|
||||||
free(b->sub_preload);
|
safe_free(b->sub_preload);
|
||||||
if (b->sub_stats)
|
if (b->sub_stats)
|
||||||
free(b->sub_stats);
|
safe_free(b->sub_stats);
|
||||||
if (!b->sub_auto)
|
if (!b->sub_auto)
|
||||||
free(b);
|
safe_free(b);
|
||||||
|
|
||||||
home->suh_blocks = NULL;
|
home->suh_blocks = NULL;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user