pidgin/pidgin

Fix some possible leaks.

16 months ago, Elliott Sales de Andrade
66604f791698
Parents 27c5004a6c65
Children 890547f0fa6e
Fix some possible leaks.
--- a/libpurple/protocols/jabber/google/google_session.c Tue Nov 05 20:21:30 2019 -0500
+++ b/libpurple/protocols/jabber/google/google_session.c Tue Nov 05 20:22:20 2019 -0500
@@ -858,7 +858,9 @@
session->remote_jid = g_strdup(session->id.initiator);
session->session_data = g_new0(GoogleAVSessionData, 1);
- google_session_handle_initiate(js, session, session_node, iq_id);
+ if (!google_session_handle_initiate(js, session, session_node, iq_id)) {
+ google_session_destroy(session);
+ }
}
#endif /* USE_VV */
--- a/libpurple/protocols/novell/nmevent.c Tue Nov 05 20:21:30 2019 -0500
+++ b/libpurple/protocols/novell/nmevent.c Tue Nov 05 20:22:20 2019 -0500
@@ -1049,14 +1049,11 @@
/* -1 means that we are not ready to callback yet. */
rc = NM_OK;
} else if (rc == NM_OK && (cb = nm_user_get_event_callback(user))) {
-
cb(user, event);
+ }
- if (event)
- nm_release_event(event);
- } else {
- if (event)
- nm_release_event(event);
+ if (event) {
+ nm_release_event(event);
}
/* Cleanup */
--- a/libpurple/xfer.c Tue Nov 05 20:21:30 2019 -0500
+++ b/libpurple/xfer.c Tue Nov 05 20:22:20 2019 -0500
@@ -235,11 +235,10 @@
if (print_thumbnail && thumbnail_data) {
gchar *message_with_img;
- gpointer data = g_memdup(thumbnail_data, size);
PurpleImage *img;
guint id;
- img = purple_image_new_from_data(data, size);
+ img = purple_image_new_from_data(thumbnail_data, size);
id = purple_image_store_add(img);
g_object_unref(img);