]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: make sure to reset the bus error struct before reusing it
authorLennart Poettering <lennart@poettering.net>
Thu, 12 Nov 2015 19:14:33 +0000 (20:14 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 12 Nov 2015 19:14:33 +0000 (20:14 +0100)
Otherwise the call might fail, because the error structure is already
initialized.

src/core/main.c

index dcd63feb828ef8da1e4649c96882ed713fbcbc8e..33529c3e7681909e03bbaadbc0a0f30d713c8acf 100644 (file)
@@ -1748,6 +1748,8 @@ int main(int argc, char *argv[]) {
                 if (r == -EPERM) {
                         log_debug("Default target could not be isolated, starting instead: %s", bus_error_message(&error, r));
 
+                        sd_bus_error_free(&error);
+
                         r = manager_add_job(m, JOB_START, target, JOB_REPLACE, &error, &default_unit_job);
                         if (r < 0) {
                                 log_emergency("Failed to start default target: %s", bus_error_message(&error, r));