Ticket #3420: code cleanup before 4.8.15 release.

Ticket #3457: (my_systemv_flags): fix memory leak.
(my_system_make_arg_array): ret rid of string duplications."

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2015-05-09 15:53:16 +03:00
parent 2641b2cc11
commit a382b1558b

View File

@ -215,8 +215,8 @@ my_system_make_arg_array (int flags, const char *shell, char **execute_name)
if ((flags & EXECUTE_AS_SHELL) != 0)
{
g_ptr_array_add (args_array, g_strdup (shell));
g_ptr_array_add (args_array, g_strdup ("-c"));
g_ptr_array_add (args_array, (gpointer) shell);
g_ptr_array_add (args_array, (gpointer) "-c");
*execute_name = g_strdup (shell);
}
else
@ -229,7 +229,7 @@ my_system_make_arg_array (int flags, const char *shell, char **execute_name)
else
*execute_name = g_strndup (shell, (gsize) (shell_token - shell));
g_ptr_array_add (args_array, g_strdup (shell));
g_ptr_array_add (args_array, (gpointer) shell);
}
return args_array;
}