From 5cef9b4921147a89eda67f1f55dcf4ee1807af60 Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Fri, 22 Mar 2019 00:38:46 +0100 Subject: fr-process: Fix memory leak: 'g_shell_quote' needs to be freed --- src/fr-process.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/fr-process.c b/src/fr-process.c index cc8887e..643e29a 100644 --- a/src/fr-process.c +++ b/src/fr-process.c @@ -699,21 +699,33 @@ start_current_command (FrProcess *process) if (g_str_has_suffix (argv[2], ".7z")) { g_string_append (commandline, " "); - g_string_append (commandline, g_shell_quote (argv[2])); + + gchar *tempstr = g_shell_quote (argv[2]); + g_string_append (commandline, tempstr); + g_free (tempstr); + g_string_append (commandline, ".*"); fixname = TRUE; } else if (g_str_has_suffix (argv[2], ".rar")) { rarfile[strlen(rarfile) - 5] = 0; g_string_append (commandline, " "); - g_string_append (commandline, g_shell_quote (rarfile)); + + gchar *tempstr = g_shell_quote (rarfile); + g_string_append (commandline, tempstr); + g_free (tempstr); + g_string_append (commandline, "*.rar"); fixname = TRUE; } } else if ((i == 4) && (fixname)) { g_string_append (commandline, " \"$(dirname "); - g_string_append (commandline, g_shell_quote (argv[3])); + + gchar *tempstr = g_shell_quote (argv[3]); + g_string_append (commandline, tempstr); + g_free (tempstr); + g_string_append (commandline, ")\""); } else { -- cgit v1.2.1