From 305bdcf9781db910ee6a50e6cb8764f634d91e93 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Tue, 21 Apr 2015 14:14:26 +0200 Subject: [PATCH] test_command_line_internal: Fix variable original_argv going out of scope leaks the storage it points to (CID 60588). Reported by Coverity: CID 60588: Resource leak (RESOURCE_LEAK) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90089 Reviewed-by: Simon McVittie --- test/shell-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/shell-test.c b/test/shell-test.c index 1938379..61280d6 100644 --- a/test/shell-test.c +++ b/test/shell-test.c @@ -93,15 +93,15 @@ test_command_line_internal (dbus_bool_t should_work, dbus_free_string_array (shell_argv); } + _dbus_string_free (&str); + dbus_free (original_argv); + if (!should_work) { printf ("# Expected an error\n"); return FALSE; } - _dbus_string_free (&str); - dbus_free (original_argv); - return TRUE; } -- 1.8.4.5