From 3768a1217f8ba1698dad6ee355abbfa3531d6f71 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Tue, 10 Nov 2015 22:36:18 +0100 Subject: [PATCH 3/3] shell-test: Calling _dbus_string_init without checking return value (CID 60587). Reported by Coverity: CID 60587: Unchecked return value (CHECKED_RETURN) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021 --- test/shell-test.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/shell-test.c b/test/shell-test.c index 47dcb11..6fa7a88 100644 --- a/test/shell-test.c +++ b/test/shell-test.c @@ -37,7 +37,12 @@ test_command_line_internal (dbus_bool_t should_work, original_argc = _dbus_list_get_length (&list); original_argv = dbus_new (char *, original_argc); if (!_dbus_string_init (&str)) - return FALSE; + { + _dbus_list_clear (&list); + dbus_free (original_argv); + return FALSE; + } + for (i = 0, node = _dbus_list_get_first_link (&list); i < original_argc && node; i++, node = _dbus_list_get_next_link (&list, node)) { @@ -58,6 +63,7 @@ test_command_line_internal (dbus_bool_t should_work, should_work ? "" : " (as expected)", error.message ? error.message : ""); dbus_free (original_argv); + _dbus_string_free (&str); return !should_work; } else -- 1.8.4.5