dbus_test_tool_spam: Fix 'variable random_sizes going out of scope leaks the storage it points to' (CID 54761)

Reported by Coverity: CID 54761: Resource leak (RESOURCE_LEAK)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
Ralf Habacker 2015-04-20 21:40:14 +02:00
parent 1ba6c3956b
commit 580b44f72d

View file

@ -367,6 +367,7 @@ dbus_test_tool_spam (int argc, char **argv)
fprintf (stderr, "Failed to connect to bus: %s: %s\n",
error.name, error.message);
dbus_error_free (&error);
dbus_free (random_sizes);
return 1;
}
@ -512,6 +513,7 @@ dbus_test_tool_spam (int argc, char **argv)
VERBOSE (stderr, "Done\n");
dbus_free (payload_buf);
dbus_free (random_sizes);
if (template != NULL)
dbus_message_unref (template);