about summary refs log tree commit diff stats
path: root/src/plugins
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-02-15 00:09:51 +0000
committerJames Booth <boothj5@gmail.com>2016-02-15 00:09:51 +0000
commit7945ef52773e78f41f3b9b4b29c6346a303fb4b8 (patch)
treec9fcba3eeab49d2272e079137863790bc99048d9 /src/plugins
parentbd928f0f29ba20cc8712e7fc76e4ac7deefb6cb7 (diff)
downloadprofani-tty-7945ef52773e78f41f3b9b4b29c6346a303fb4b8.tar.gz
Fix plugin command memleak
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/callbacks.c3
-rw-r--r--src/plugins/plugins.c1
2 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/callbacks.c b/src/plugins/callbacks.c
index 4654be70..9da8947e 100644
--- a/src/plugins/callbacks.c
+++ b/src/plugins/callbacks.c
@@ -92,13 +92,14 @@ plugins_run_command(const char * const input)
             gchar **args = parse_args(input, command->min_args, command->max_args, &result);
             if (result == FALSE) {
                 ui_invalid_command_usage(command->usage, NULL);
+                g_strfreev(split);
                 return TRUE;
             } else {
                 command->callback_func(command, args);
                 g_strfreev(split);
+                g_strfreev(args);
                 return TRUE;
             }
-            g_strfreev(args);
         }
         p_command = g_slist_next(p_command);
     }
diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c
index 92fa1686..b39bc355 100644
--- a/src/plugins/plugins.c
+++ b/src/plugins/plugins.c
@@ -92,6 +92,7 @@ plugins_init(void)
             curr = g_slist_next(curr);
         }
     }
+    prefs_free_plugins(plugins_load);
 
     return;
 }