diff mcabber/src/compl.c @ 1076:b9698c89f46d

Fix memory leak in scr_handle_tab()
author Mikael Berthe <mikael@lilotux.net>
date Sun, 03 Dec 2006 21:15:37 +0100
parents f76b32ff2f14
children 2de8f8ba1f34
line wrap: on
line diff
--- a/mcabber/src/compl.c	Sun Dec 03 19:29:54 2006 +0100
+++ b/mcabber/src/compl.c	Sun Dec 03 21:15:37 2006 +0100
@@ -202,9 +202,14 @@
 
 //  compl_get_category_list()
 // Returns a slist of all words in the categories specified by the given flags
-GSList *compl_get_category_list(guint cat_flags)
+// Iff this function sets *dynlist to TRUE, then the caller must free the
+// whole list after use.
+GSList *compl_get_category_list(guint cat_flags, guint *dynlist)
 {
   GSList *sl_cat;
+
+  *dynlist = FALSE;
+
   // Look for category
   // XXX Actually that's not that simple... cat_flags can be a combination
   // of several flags!
@@ -216,6 +221,7 @@
     return ((category*)sl_cat->data)->words;
 
   // Handle dynamic SLists
+  *dynlist = TRUE;
   if (cat_flags == COMPL_GROUPNAME) {
     return compl_list(ROSTER_TYPE_GROUP);
   }
@@ -229,6 +235,7 @@
     return evs_geteventslist(TRUE);
   }
 
+  *dynlist = FALSE;
   return NULL;
 }