mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-26 20:48:21 +00:00
FS-3386 fix small mem leak in sofia
This commit is contained in:
parent
25c725c292
commit
6f62f39139
@ -1113,14 +1113,19 @@ static void our_sofia_event_callback(nua_event_t event,
|
|||||||
void sofia_process_dispatch_event(sofia_dispatch_event_t **dep)
|
void sofia_process_dispatch_event(sofia_dispatch_event_t **dep)
|
||||||
{
|
{
|
||||||
sofia_dispatch_event_t *de = *dep;
|
sofia_dispatch_event_t *de = *dep;
|
||||||
|
nua_handle_t *nh = de->nh;
|
||||||
|
nua_t *nua = de->nua;
|
||||||
|
|
||||||
*dep = NULL;
|
*dep = NULL;
|
||||||
|
|
||||||
our_sofia_event_callback(de->data->e_event, de->data->e_status, de->data->e_phrase, de->nua, de->profile,
|
our_sofia_event_callback(de->data->e_event, de->data->e_status, de->data->e_phrase, de->nua, de->profile,
|
||||||
de->nh, nua_handle_magic(de->nh), de->sip, de, (tagi_t *) de->data->e_tags);
|
de->nh, nua_handle_magic(de->nh), de->sip, de, (tagi_t *) de->data->e_tags);
|
||||||
nua_handle_unref(de->nh);
|
|
||||||
nua_stack_unref(de->nua);
|
nua_destroy_event(de->event);
|
||||||
nua_destroy_event(de->event);
|
su_free(nh->nh_home, de);
|
||||||
free(de);
|
|
||||||
|
nua_handle_unref(nh);
|
||||||
|
nua_stack_unref(nua);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1217,7 +1222,8 @@ void sofia_event_callback(nua_event_t event,
|
|||||||
{
|
{
|
||||||
sofia_dispatch_event_t *de;
|
sofia_dispatch_event_t *de;
|
||||||
|
|
||||||
de = calloc(1, sizeof *de);
|
de = su_alloc(nh->nh_home, sizeof(*de));
|
||||||
|
memset(de, 0, sizeof(*de));
|
||||||
nua_save_event(nua, de->event);
|
nua_save_event(nua, de->event);
|
||||||
de->nh = nua_handle_ref(nh);
|
de->nh = nua_handle_ref(nh);
|
||||||
de->data = nua_event_data(de->event);
|
de->data = nua_event_data(de->event);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user