From db7091dca2f3bf348b0c8cb7197a4da2461f7e19 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 6 Mar 2019 19:19:38 +0100 Subject: [PATCH] bus-unit-util: insist on full initialization --- src/shared/bus-unit-util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index e753eafd85..a25e82e017 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -1987,6 +1987,7 @@ finish: static int check_wait_response(BusWaitForJobs *d, bool quiet, const char* const* extra_args) { assert(d); + assert(d->name); assert(d->result); if (!quiet) { @@ -2055,14 +2056,14 @@ int bus_wait_for_jobs(BusWaitForJobs *d, bool quiet, const char* const* extra_ar if (q < 0) return log_error_errno(q, "Failed to wait for response: %m"); - if (d->result) { + if (d->name && d->result) { q = check_wait_response(d, quiet, extra_args); /* Return the first error as it is most likely to be * meaningful. */ if (q < 0 && r == 0) r = q; - log_debug_errno(q, "Got result %s/%m for job %s", strna(d->result), strna(d->name)); + log_debug_errno(q, "Got result %s/%m for job %s", d->result, d->name); } d->name = mfree(d->name);