about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-11-03 20:57:22 +0000
committerJames Booth <boothj5@gmail.com>2014-11-03 20:57:22 +0000
commitc4ab9405f64b4faecde951cb4b575062b30e4f79 (patch)
treeb10d4432bd46e49b237c71405a0049115ba13071 /src/command
parentc4412fe82385945a5a056640135e9b53901d563f (diff)
downloadprofani-tty-c4ab9405f64b4faecde951cb4b575062b30e4f79.tar.gz
Fixed leaks in /affiliation and /role
Diffstat (limited to 'src/command')
-rw-r--r--src/command/command.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/command/command.c b/src/command/command.c
index da908c02..2c3bd3ba 100644
--- a/src/command/command.c
+++ b/src/command/command.c
@@ -2074,10 +2074,13 @@ _bookmark_autocomplete(char *input, int *size)
         }
         g_string_free(beginning, TRUE);
         if (found != NULL) {
+            g_strfreev(args);
             return found;
         }
     }
 
+    g_strfreev(args);
+
     found = autocomplete_param_with_func(input, size, "/bookmark remove", bookmark_find);
     if (found != NULL) {
         return found;
@@ -2248,10 +2251,13 @@ _otr_autocomplete(char *input, int *size)
         found = autocomplete_param_with_func(input, size, beginning->str, roster_find_contact);
         g_string_free(beginning, TRUE);
         if (found != NULL) {
+            g_strfreev(args);
             return found;
         }
     }
 
+    g_strfreev(args);
+
     found = autocomplete_param_with_ac(input, size, "/otr policy", otr_policy_ac, TRUE);
     if (found != NULL) {
         return found;
@@ -2461,10 +2467,13 @@ _affiliation_autocomplete(char *input, int *size)
         result = autocomplete_param_with_ac(input, size, beginning->str, jid_ac, TRUE);
         g_string_free(beginning, TRUE);
         if (result != NULL) {
+            g_strfreev(args);
             return result;
         }
     }
 
+    g_strfreev(args);
+
     result = autocomplete_param_with_ac(input, size, "/affiliation set", affiliation_ac, TRUE);
     if (result != NULL) {
         return result;
@@ -2503,10 +2512,13 @@ _role_autocomplete(char *input, int *size)
         result = autocomplete_param_with_ac(input, size, beginning->str, nick_ac, TRUE);
         g_string_free(beginning, TRUE);
         if (result != NULL) {
+            g_strfreev(args);
             return result;
         }
     }
 
+    g_strfreev(args);
+
     result = autocomplete_param_with_ac(input, size, "/role set", role_ac, TRUE);
     if (result != NULL) {
         return result;
@@ -2592,10 +2604,13 @@ _connect_autocomplete(char *input, int *size)
         found = autocomplete_param_with_ac(input, size, beginning->str, connect_property_ac, TRUE);
         g_string_free(beginning, TRUE);
         if (found != NULL) {
+            g_strfreev(args);
             return found;
         }
     }
 
+    g_strfreev(args);
+
     found = autocomplete_param_with_func(input, size, "/connect", accounts_find_enabled);
     if (found != NULL) {
         return found;
@@ -2631,10 +2646,13 @@ _join_autocomplete(char *input, int *size)
         found = autocomplete_param_with_ac(input, size, beginning->str, join_property_ac, TRUE);
         g_string_free(beginning, TRUE);
         if (found != NULL) {
+            g_strfreev(args);
             return found;
         }
     }
 
+    g_strfreev(args);
+
     return NULL;
 }
 
@@ -2656,12 +2674,14 @@ _account_autocomplete(char *input, int *size)
             found = autocomplete_param_with_ac(input, size, beginning->str, otr_policy_ac, TRUE);
             g_string_free(beginning, TRUE);
             if (found != NULL) {
+                g_strfreev(args);
                 return found;
             }
         } else {
             found = autocomplete_param_with_ac(input, size, beginning->str, account_set_ac, TRUE);
             g_string_free(beginning, TRUE);
             if (found != NULL) {
+                g_strfreev(args);
                 return found;
             }
         }
@@ -2673,6 +2693,7 @@ _account_autocomplete(char *input, int *size)
         found = autocomplete_param_with_ac(input, size, beginning->str, account_clear_ac, TRUE);
         g_string_free(beginning, TRUE);
         if (found != NULL) {
+            g_strfreev(args);
             return found;
         }
     }