mcabber/src/screen.c
changeset 1076 b9698c89f46d
parent 1075 03bc225ad763
child 1077 c51ca5225516
--- a/mcabber/src/screen.c	Sun Dec 03 19:29:54 2006 +0100
+++ b/mcabber/src/screen.c	Sun Dec 03 21:15:37 2006 +0100
@@ -2310,12 +2310,21 @@
   }
 
   if (!completion_started) {
-    GSList *list = compl_get_category_list(compl_categ);
+    guint dynlist;
+    GSList *list = compl_get_category_list(compl_categ, &dynlist);
     if (list) {
       char *prefix = g_strndup(row, ptr_inputline-row);
       // Init completion
       new_completion(prefix, list);
       g_free(prefix);
+      // Free the list if it's a dynamic one
+      if (dynlist) {
+        GSList *slp;
+        for (slp = list; slp; slp = g_slist_next(slp))
+          g_free(slp->data);
+        g_slist_free(list);
+
+      }
       // Now complete
       cchar = complete();
       if (cchar)