From a382b1558bef403d6fdc7d1c4dd360b1f7deca4a Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sat, 9 May 2015 15:53:16 +0300 Subject: [PATCH] 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 --- lib/utilunix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/utilunix.c b/lib/utilunix.c index 50175af53..fed8c087f 100644 --- a/lib/utilunix.c +++ b/lib/utilunix.c @@ -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; }