changeset 24821:75690a3eeee0

Fix a potential leak "KuSh" discovered using "cppcheck". Fixes #7863.
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 22 Dec 2008 16:13:43 +0000
parents 0700833f0c5d
children 4455637864b4
files libpurple/server.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/server.c	Mon Dec 22 07:51:06 2008 +0000
+++ b/libpurple/server.c	Mon Dec 22 16:13:43 2008 +0000
@@ -804,7 +804,7 @@
 {
 	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 @@
 		}
 	}
 
+	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));