From da6de8a55784115451582051c8da620056994a05 Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Mon, 20 Jan 2014 11:05:22 +0100 Subject: [PATCH] analyze: fix crash in command line parsing Ensure DBusError is set before it can possibly be freed on return. Fix crash when calling set-log-level without any parameter. Fix https://bugzilla.novell.com/show_bug.cgi?id=859365 --- src/analyze/systemd-analyze.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analyze/systemd-analyze.c b/src/analyze/systemd-analyze.c index 27d063c..cdfae93 100644 --- a/src/analyze/systemd-analyze.c +++ b/src/analyze/systemd-analyze.c @@ -1226,13 +1226,13 @@ static int set_log_level(DBusConnection *bus, char **args) { assert(bus); assert(args); + dbus_error_init(&error); if (strv_length(args) != 1) { log_error("This command expects one argument only."); return -E2BIG; } value = args[0]; - dbus_error_init(&error); m = dbus_message_new_method_call("org.freedesktop.systemd1", "/org/freedesktop/systemd1", -- 1.8.4