pidgin: cb40166c: Fix a potential leak "KuSh" discovered u...

datallah at pidgin.im datallah at pidgin.im
Mon Dec 22 12:06:01 EST 2008


-----------------------------------------------------------------
Revision: cb40166cf43bdc5d123509c6f2dfe83441c98018
Ancestor: b91b500b28cdf7b1ff8e46c5957519556a7f26db
Author: datallah at pidgin.im
Date: 2008-12-22T16:13:43
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/cb40166cf43bdc5d123509c6f2dfe83441c98018

Modified files:
        libpurple/server.c

ChangeLog: 

Fix a potential leak "KuSh" discovered using "cppcheck". Fixes #7863.

-------------- next part --------------
============================================================
--- libpurple/server.c	ecf8d59e0327b248867616ce42c9b88ae0100241
+++ libpurple/server.c	220d6ae72c784eab7d626b35d56bf996ee66a3cb
@@ -804,7 +804,7 @@ void serv_got_chat_invite(PurpleConnecti
 {
 	PurpleAccount *account;
 	char buf2[BUF_LONG];
-	struct chat_invite_data *cid = g_new0(struct chat_invite_data, 1);
+	struct chat_invite_data *cid;
 	int plugin_return;
 
 	account = purple_connection_get_account(gc);
@@ -817,6 +817,8 @@ void serv_got_chat_invite(PurpleConnecti
 		}
 	}
 
+	cid = g_new0(struct chat_invite_data, 1);
+
 	plugin_return = GPOINTER_TO_INT(purple_signal_emit_return_1(
 					purple_conversations_get_handle(),
 					"chat-invited", account, who, name, message, data));


More information about the Commits mailing list