libpurple/plugins/perl/common/Cmds.xs

branch
release-2.3.1
changeset 21737
fa92350ed598
parent 16773
e1171eb45f07
child 36545
23b59a16c808
--- a/libpurple/plugins/perl/common/Cmds.xs	Thu Dec 06 01:17:36 2007 +0000
+++ b/libpurple/plugins/perl/common/Cmds.xs	Thu Dec 06 01:19:19 2007 +0000
@@ -66,21 +66,23 @@
 	Purple::Conversation conv
 	const gchar *command
 PREINIT:
-	GList *l;
+	GList *l, *ll;
 PPCODE:
-	for (l = purple_cmd_help(conv, command); l != NULL; l = l->next) {
+	for (l = ll = purple_cmd_help(conv, command); l != NULL; l = l->next) {
 		XPUSHs(sv_2mortal(newSVpv(l->data, 0)));
 	}
+	g_list_free(ll);
 
 void
 purple_cmd_list(conv)
 	Purple::Conversation conv
 PREINIT:
-	GList *l;
+	GList *l, *ll;
 PPCODE:
-	for (l = purple_cmd_list(conv); l != NULL; l = l->next) {
+	for (l = ll = purple_cmd_list(conv); l != NULL; l = l->next) {
 		XPUSHs(sv_2mortal(newSVpv(l->data, 0)));
 	}
+	g_list_free(ll);
 
 Purple::Cmd::Id
 purple_cmd_register(plugin, command, args, priority, flag, prpl_id, func, helpstr, data = 0)

mercurial