Blob Blame History Raw
From: Ken Gaillot <kgaillot@redhat.com>
Date: Mon, 17 Aug 2015 10:28:19 -0500
Subject: [PATCH] Fix: tools: memory leak in crm_resource

(cherry picked from commit c11bc4b856b07d5ea5b8284a3d566dd782e6bb7c)
---
 tools/crm_resource_runtime.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/crm_resource_runtime.c b/tools/crm_resource_runtime.c
index f260e19..b9427bc 100644
--- a/tools/crm_resource_runtime.c
+++ b/tools/crm_resource_runtime.c
@@ -399,9 +399,11 @@ cli_resource_delete_attribute(const char *rsc_id, const char *attr_set, const ch
                             &local_attr_id);
 
     if (rc == -ENXIO) {
+        free(lookup_id);
         return pcmk_ok;
 
     } else if (rc != pcmk_ok) {
+        free(lookup_id);
         return rc;
     }
 
@@ -424,6 +426,7 @@ cli_resource_delete_attribute(const char *rsc_id, const char *attr_set, const ch
                attr_name ? " name=" : "", attr_name ? attr_name : "");
     }
 
+    free(lookup_id);
     free_xml(xml_obj);
     free(local_attr_id);
     return rc;