fix memory leak

This commit is contained in:
Benjamin Reis 2018-03-29 15:40:44 +02:00
parent c651d019b1
commit e86659a97e
2 changed files with 5 additions and 3 deletions

View file

@ -605,10 +605,11 @@ static void notify(SalSubscribeOp *op, SalSubscribeStatus st, const char *eventn
lev = linphone_event_new_with_out_of_dialog_op(lc,op,LinphoneSubscriptionOutgoing,eventname);
}
{
LinphoneContent *ct=linphone_content_from_sal_body_handler(body_handler);
if (ct)
LinphoneContent *ct = linphone_content_from_sal_body_handler(body_handler);
if (ct) {
linphone_core_notify_notify_received(lc,lev,eventname,ct);
linphone_content_unref(ct);
}
}
if (out_of_dialog){
/*out of dialog NOTIFY do not create an implicit subscription*/

View file

@ -2136,6 +2136,7 @@ static void linphone_core_internal_notify_received(LinphoneCore *lc, LinphoneEve
} else if (strcmp(notified_event, "conference") == 0) {
const LinphoneAddress *resource = linphone_event_get_resource(lev);
if (strcmp(linphone_address_as_string_uri_only(resource), linphone_proxy_config_get_conference_factory_uri(linphone_core_get_default_proxy_config(lc))) == 0) {
linphone_content_ref((LinphoneContent *) body);
L_GET_PRIVATE_FROM_C_OBJECT(lc)->remoteListEventHandler->notifyReceived(L_GET_CPP_PTR_FROM_C_OBJECT(body));
return;
}