From 7bc38f59dc6c54fcabc5f44ecb20ab43dda0838d Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 9 Feb 2021 19:07:35 +0900 Subject: [PATCH] log: do not use uninitialized value Follow-up for 85cf96e3f567cd51f79d671bbf3559550fdd67b7. --- src/basic/log.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.47.3