From: Yu Watanabe Date: Tue, 9 Feb 2021 10:07:35 +0000 (+0900) Subject: log: do not use uninitialized value X-Git-Tag: v248-rc1~180 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7bc38f59dc6c54fcabc5f44ecb20ab43dda0838d;p=thirdparty%2Fsystemd.git log: do not use uninitialized value Follow-up for 85cf96e3f567cd51f79d671bbf3559550fdd67b7. --- diff --git a/src/basic/log.c b/src/basic/log.c index 6a86fab3986..ff501af5699 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -1175,9 +1175,11 @@ static bool should_parse_proc_cmdline(void) { /* For testing. */ return true; - if (parse_pid(e, &p) < 0) + if (parse_pid(e, &p) < 0) { /* We know that systemd sets the variable correctly. Something else must have set it. */ log_debug("Failed to parse \"$SYSTEMD_EXEC_PID=%s\". Ignoring.", e); + return false; + } return getpid_cached() == p; }