From: Lennart Poettering Date: Wed, 6 Mar 2019 18:19:38 +0000 (+0100) Subject: bus-unit-util: insist on full initialization X-Git-Tag: v242-rc1~131^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db7091dca2f3bf348b0c8cb7197a4da2461f7e19;p=thirdparty%2Fsystemd.git bus-unit-util: insist on full initialization --- diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index e753eafd85a..a25e82e0176 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);