From: Ralf Habacker Date: Tue, 21 Apr 2015 12:14:26 +0000 (+0200) Subject: test_command_line_internal: Fix variable original_argv going out of scope leaks the... X-Git-Tag: dbus-1.9.16~35 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c396b8ea5694852c7c89d3bf3b2ce1f1d68c0288;p=thirdparty%2Fdbus.git 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=90021 Reviewed-by: Simon McVittie --- diff --git a/test/shell-test.c b/test/shell-test.c index 1938379e2..61280d683 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; }