Blob Blame History Raw
From e4d9c795dfe2d6737c777a265292864da98dae8f Mon Sep 17 00:00:00 2001
From: Reid Wahl <nrwahl@protonmail.com>
Date: Thu, 30 Jun 2022 14:40:31 -0700
Subject: [PATCH] Low: Always null-check result in stonith__rhcs_get_metadata

Null-check result even if rc == 0.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
---
 lib/fencing/st_rhcs.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/fencing/st_rhcs.c b/lib/fencing/st_rhcs.c
index 029c97eea..dfccff2cb 100644
--- a/lib/fencing/st_rhcs.c
+++ b/lib/fencing/st_rhcs.c
@@ -132,9 +132,11 @@ stonith__rhcs_get_metadata(const char *agent, int timeout, xmlNode **metadata)
     int rc = stonith__execute(action);
     result = stonith__action_result(action);
 
-    if (rc < 0 && result == NULL) {
-        crm_warn("Could not execute metadata action for %s: %s "
-                 CRM_XS " rc=%d", agent, pcmk_strerror(rc), rc);
+    if (result == NULL) {
+        if (rc < 0) {
+            crm_warn("Could not execute metadata action for %s: %s "
+                     CRM_XS " rc=%d", agent, pcmk_strerror(rc), rc);
+        }
         stonith__destroy_action(action);
         return rc;
     }
-- 
2.31.1