im.pidgin.pidgin: 77bcc84e640fbcff59c36ae926af3e0b74dbbbb8

andrew at gaul.org andrew at gaul.org
Fri Feb 29 03:00:45 EST 2008


-----------------------------------------------------------------
Revision: 77bcc84e640fbcff59c36ae926af3e0b74dbbbb8
Ancestor: 4513e6420589970488f23e640cb842c933e326c1
Author: andrew at gaul.org
Date: 2008-02-29T07:55:20
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/77bcc84e640fbcff59c36ae926af3e0b74dbbbb8

Modified files:
        libpurple/protocols/irc/cmds.c

ChangeLog: 

Fixes a memleak:

==17163== 7 bytes in 1 blocks are definitely lost in loss record 7 of 214
==17163==    at 0x4006A6E: malloc (vg_replace_malloc.c:207)
==17163==    by 0xA1CAF5: g_malloc (in /lib/libglib-2.0.so.0.1400.6)
==17163==    by 0xA35348: g_strdup (in /lib/libglib-2.0.so.0.1400.6)
==17163==    by 0xA35BF9: g_strsplit (in /lib/libglib-2.0.so.0.1400.6)
==17163==    by 0x52D5DF2: irc_cmd_op (cmds.c:290)


-------------- next part --------------
============================================================
--- libpurple/protocols/irc/cmds.c	2df3a36f517accc14242af056f33f8c62a1c81cf
+++ libpurple/protocols/irc/cmds.c	a6d877b741cce2a63467616046357c8cc276d3bd
@@ -294,17 +294,15 @@ int irc_cmd_op(struct irc_conn *irc, con
 	ops = g_new0(char *, i * 2 + 1);
 
 	for (i = 0; nicks[i]; i++) {
-		if (!*nicks[i]) {
-			g_free(nicks[i]);
-			continue;
+		if (*nicks[i]) {
+			ops[used++] = mode;
+			ops[used++] = nicks[i];
 		}
-		ops[used++] = mode;
-		ops[used++] = nicks[i];
 	}
 
 	irc_do_mode(irc, target, sign, ops);
 	g_free(ops);
-	g_free(nicks);  /* No, not g_strfreev */
+	g_strfreev(nicks);
 
 	return 0;
 }


More information about the Commits mailing list