From 7dda20dac25f07eae959ca25cc974ef2fa6daf02 Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Wed, 24 Apr 2019 16:25:46 -0500
Subject: [PATCH] Fix: libcrmcommon: avoid use-of-NULL when checking whether
process is active
---
lib/common/pid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/common/pid.c b/lib/common/pid.c
index 2439680..4fbf2dd 100644
--- a/lib/common/pid.c
+++ b/lib/common/pid.c
@@ -57,7 +57,7 @@ crm_pid_active(long pid, const char *daemon)
} else if (rc == 0 && (daemon == NULL || have_proc_pid == -1)) {
return 1; /* kill as the only indicator, cannot double check */
- } else {
+ } else if (daemon != NULL) {
/* make sure PID hasn't been reused by another process
XXX: might still be just a zombie, which could confuse decisions */
bool checked_through_kill = (rc == 0);
--
1.8.3.1