Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
e63f2ba1
Commit
e63f2ba1
authored
Nov 30, 2015
by
Ghislain MARY
Browse files
Fix some memory leaks.
parent
7885a5c8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
coreapi/callbacks.c
coreapi/callbacks.c
+4
-1
coreapi/friendlist.c
coreapi/friendlist.c
+6
-0
gtk/utils.c
gtk/utils.c
+1
-0
No files found.
coreapi/callbacks.c
View file @
e63f2ba1
...
...
@@ -1309,7 +1309,10 @@ static void notify(SalOp *op, SalSubscribeStatus st, const char *eventname, SalB
}
{
LinphoneContent
*
ct
=
linphone_content_from_sal_body_handler
(
body_handler
);
if
(
ct
)
linphone_core_notify_notify_received
(
lc
,
lev
,
eventname
,
ct
);
if
(
ct
)
{
linphone_core_notify_notify_received
(
lc
,
lev
,
eventname
,
ct
);
linphone_content_unref
(
ct
);
}
}
if
(
st
!=
SalSubscribeNone
){
linphone_event_set_state
(
lev
,
linphone_subscription_state_from_sal
(
st
));
...
...
coreapi/friendlist.c
View file @
e63f2ba1
...
...
@@ -68,6 +68,7 @@ static char * create_resource_list_xml(const LinphoneFriendList *list) {
/* Close the "entry" element. */
err
=
xmlTextWriterEndElement
(
writer
);
}
if
(
uri
)
ms_free
(
uri
);
}
if
(
err
>=
0
)
{
/* Close the "list" element. */
...
...
@@ -116,6 +117,7 @@ static void linphone_friend_list_parse_multipart_related_body(LinphoneFriendList
goto
end
;
}
version
=
atoi
(
version_str
);
linphone_free_xml_text_content
(
version_str
);
if
(
version
<
list
->
expected_notification_version
)
{
ms_warning
(
"rlmi+xml: Discarding received notification with version %d because %d was expected"
,
version
,
list
->
expected_notification_version
);
goto
end
;
...
...
@@ -170,6 +172,7 @@ static void linphone_friend_list_parse_multipart_related_body(LinphoneFriendList
linphone_core_notify_notify_presence_received
(
list
->
lc
,
friend
);
}
}
linphone_content_unref
(
presence_part
);
}
}
if
(
cid
!=
NULL
)
linphone_free_xml_text_content
(
cid
);
...
...
@@ -379,6 +382,7 @@ void linphone_friend_list_update_subscriptions(LinphoneFriendList *list, Linphon
linphone_content_set_subtype
(
content
,
"resource-lists+xml"
);
linphone_content_set_string_buffer
(
content
,
xml_content
);
linphone_event_send_subscribe
(
event
,
content
);
linphone_content_unref
(
content
);
}
if
(
address
!=
NULL
)
linphone_address_unref
(
address
);
if
(
xml_content
!=
NULL
)
ms_free
(
xml_content
);
...
...
@@ -427,9 +431,11 @@ void linphone_friend_list_notify_presence_received(LinphoneFriendList *list, Lin
subtype
=
linphone_content_get_subtype
(
first_part
);
if
((
strcmp
(
type
,
"application"
)
!=
0
)
||
(
strcmp
(
subtype
,
"rlmi+xml"
)
!=
0
))
{
ms_warning
(
"multipart presence notified but first part is not 'application/rlmi+xml'"
);
linphone_content_unref
(
first_part
);
return
;
}
linphone_friend_list_parse_multipart_related_body
(
list
,
body
,
linphone_content_get_string_buffer
(
first_part
));
linphone_content_unref
(
first_part
);
}
}
gtk/utils.c
View file @
e63f2ba1
...
...
@@ -118,6 +118,7 @@ bool_t linphone_gtk_is_friend(LinphoneCore *lc, const char *contact) {
char
*
uri
=
linphone_address_as_string_uri_only
(
addr
);
LinphoneFriend
*
lf
=
linphone_core_get_friend_by_address
(
lc
,
uri
);
linphone_address_destroy
(
addr
);
if
(
uri
)
ms_free
(
uri
);
if
(
lf
)
return
TRUE
;
}
return
FALSE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment