summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-03-22 00:38:46 +0100
committerPablo Barciela <[email protected]>2019-03-31 00:15:16 +0100
commit5cef9b4921147a89eda67f1f55dcf4ee1807af60 (patch)
treea58e11dc4572c8161d39b106c080da1559a43e25
parent44d2b1e74cf31b2b80fcdae4c02356cea31bf154 (diff)
downloadengrampa-5cef9b4921147a89eda67f1f55dcf4ee1807af60.tar.bz2
engrampa-5cef9b4921147a89eda67f1f55dcf4ee1807af60.tar.xz
fr-process: Fix memory leak: 'g_shell_quote' needs to be freed
-rw-r--r--src/fr-process.c18
1 files changed, 15 insertions, 3 deletions
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 {