]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
test_command_line_internal: Fix 'variable shell_argv going out of scope leaks the...
authorRalf Habacker <ralf.habacker@freenet.de>
Mon, 20 Apr 2015 19:55:27 +0000 (21:55 +0200)
committerRalf Habacker <ralf.habacker@freenet.de>
Fri, 1 May 2015 21:05:05 +0000 (23:05 +0200)
Reported by Coverity: CID 54751: Resource leak (RESOURCE_LEAK)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
test/shell-test.c

index 23a1bb4683aa7a1fcf4df4b3e586995f27ffaffd..1938379e29a412a04e7d38d06f1f071645628d47 100644 (file)
@@ -66,6 +66,7 @@ test_command_line_internal (dbus_bool_t should_work,
           printf ("# Number of arguments returned (%d) don't match original (%d)\n",
                   shell_argc, original_argc);
           dbus_free (original_argv);
+          dbus_free_string_array (shell_argv);
           return FALSE;
         } 
       printf ("# Number of arguments: %d\n", shell_argc);
@@ -81,6 +82,7 @@ test_command_line_internal (dbus_bool_t should_work,
                       i, shell_argv[i], unquoted);
               dbus_free (unquoted);
               dbus_free (original_argv);
+              dbus_free_string_array (shell_argv);
               return FALSE;
             }
           dbus_free (unquoted);