diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 81a768c25..1bd201eac 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -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*/ diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 2a826f0e3..bf3c1aa65 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -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; }