summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-03-22 00:38:46 +0100
committerZenWalker <[email protected]>2019-03-31 00:13:32 +0100
commit70050ca8f98012655963aec8cfc13f08388640c2 (patch)
tree8e2b0b702f0d873bbf21a431a2d2fbba04222462
parentae657ba29ef5960d80bf249c89d1de370a1d22c5 (diff)
downloadengrampa-70050ca8f98012655963aec8cfc13f08388640c2.tar.bz2
engrampa-70050ca8f98012655963aec8cfc13f08388640c2.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 {