Commit f7abf572 authored by Ghislain MARY's avatar Ghislain MARY

Fix some memory leaks.

parent b88693f4
......@@ -358,8 +358,8 @@ LinphoneEvent *linphone_event_ref(LinphoneEvent *lev){
}
static void linphone_event_destroy(LinphoneEvent *lev){
if (lev->op)
sal_op_release(lev->op);
if (lev->op) sal_op_release(lev->op);
if (lev->send_custom_headers) sal_custom_header_free(lev->send_custom_headers);
ms_free(lev->name);
}
......
......@@ -623,7 +623,6 @@ void linphone_friend_list_update_subscriptions(LinphoneFriendList *list, Linphon
linphone_event_unref(list->event);
}
list->event = linphone_core_create_subscribe(list->lc, address, "presence", expires);
linphone_event_ref(list->event);
linphone_event_set_internal(list->event, TRUE);
linphone_event_add_custom_header(list->event, "Require", "recipient-list-subscribe");
linphone_event_add_custom_header(list->event, "Supported", "eventlist");
......
......@@ -1111,6 +1111,7 @@ int linphone_proxy_config_send_publish(LinphoneProxyConfig *proxy, LinphonePrese
linphone_content_set_subtype(content,"pidf+xml");
err = linphone_event_send_publish(proxy->long_term_event, content);
linphone_content_unref(content);
ms_free(presence_body);
}else proxy->send_publish=TRUE; /*otherwise do not send publish if registration is in progress, this will be done later*/
return err;
}
......
......@@ -728,10 +728,13 @@ static void test_presence_list_base(bool_t enable_compression) {
linphone_friend_list_set_rls_uri(lfl, rls_uri);
lf = linphone_core_create_friend_with_address(laure->lc, marie_identity);
linphone_friend_list_add_friend(lfl, lf);
linphone_friend_unref(lf);
lf = linphone_core_create_friend_with_address(laure->lc, pauline_identity);
linphone_friend_list_add_friend(lfl, lf);
linphone_friend_unref(lf);
lf = linphone_core_create_friend_with_address(laure->lc, "sip:michelle@sip.inexistentdomain.com");
linphone_friend_list_add_friend(lfl, lf);
linphone_friend_unref(lf);
linphone_core_remove_friend_list(laure->lc, linphone_core_get_default_friend_list(laure->lc));
linphone_core_add_friend_list(laure->lc, lfl);
linphone_friend_list_unref(lfl);
......@@ -761,6 +764,7 @@ static void test_presence_list_base(bool_t enable_compression) {
linphone_friend_list_set_rls_uri(lfl, rls_uri);
lf = linphone_core_create_friend_with_address(marie->lc, laure_identity);
linphone_friend_list_add_friend(lfl, lf);
linphone_friend_unref(lf);
linphone_core_remove_friend_list(marie->lc, linphone_core_get_default_friend_list(marie->lc));
linphone_core_add_friend_list(marie->lc, lfl);
linphone_friend_list_unref(lfl);
......@@ -778,6 +782,7 @@ static void test_presence_list_base(bool_t enable_compression) {
linphone_friend_list_set_rls_uri(lfl, rls_uri);
lf = linphone_core_create_friend_with_address(pauline->lc, marie_identity);
linphone_friend_list_add_friend(lfl, lf);
linphone_friend_unref(lf);
linphone_core_remove_friend_list(pauline->lc, linphone_core_get_default_friend_list(pauline->lc));
linphone_core_add_friend_list(pauline->lc, lfl);
linphone_friend_list_unref(lfl);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment