|
|
1f016a |
From 5147bbf46b81708a1ac544a4cfd204b50938c67c Mon Sep 17 00:00:00 2001
|
|
|
1f016a |
From: Hideo Yamauchi <renayama19661014@ybb.ne.jp>
|
|
|
1f016a |
Date: Tue, 6 Jan 2015 13:45:19 +0900
|
|
|
1f016a |
Subject: [PATCH] Fix: crmd: resolves memory leak in crmd.
|
|
|
1f016a |
|
|
|
1f016a |
---
|
|
|
1f016a |
crmd/membership.c | 10 ++++++++--
|
|
|
1f016a |
crmd/pengine.c | 1 +
|
|
|
1f016a |
2 files changed, 9 insertions(+), 2 deletions(-)
|
|
|
1f016a |
|
|
|
1f016a |
diff --git a/crmd/membership.c b/crmd/membership.c
|
|
|
1f016a |
index 9a58339..946cde0 100644
|
|
|
1f016a |
--- a/crmd/membership.c
|
|
|
1f016a |
+++ b/crmd/membership.c
|
|
|
1f016a |
@@ -215,9 +215,11 @@ search_conflicting_node_callback(xmlNode * msg, int call_id, int rc,
|
|
|
1f016a |
crm_notice("Searching conflicting nodes for %s failed: %s (%d)",
|
|
|
1f016a |
new_node_uuid, pcmk_strerror(rc), rc);
|
|
|
1f016a |
}
|
|
|
1f016a |
+ free(new_node_uuid);
|
|
|
1f016a |
return;
|
|
|
1f016a |
|
|
|
1f016a |
} else if (output == NULL) {
|
|
|
1f016a |
+ free(new_node_uuid);
|
|
|
1f016a |
return;
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
@@ -376,13 +378,17 @@ populate_cib_nodes(enum node_update_flags flags, const char *source)
|
|
|
1f016a |
|
|
|
1f016a |
g_hash_table_iter_init(&iter, crm_peer_cache);
|
|
|
1f016a |
while (g_hash_table_iter_next(&iter, NULL, (gpointer *) &node)) {
|
|
|
1f016a |
- do_update_node_cib(node, flags, node_list, source);
|
|
|
1f016a |
+ xmlNode *update = NULL;
|
|
|
1f016a |
+ update = do_update_node_cib(node, flags, node_list, source);
|
|
|
1f016a |
+ free_xml(update);
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
if (crm_remote_peer_cache) {
|
|
|
1f016a |
g_hash_table_iter_init(&iter, crm_remote_peer_cache);
|
|
|
1f016a |
while (g_hash_table_iter_next(&iter, NULL, (gpointer *) &node)) {
|
|
|
1f016a |
- do_update_node_cib(node, flags, node_list, source);
|
|
|
1f016a |
+ xmlNode *update = NULL;
|
|
|
1f016a |
+ update = do_update_node_cib(node, flags, node_list, source);
|
|
|
1f016a |
+ free_xml(update);
|
|
|
1f016a |
}
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
diff --git a/crmd/pengine.c b/crmd/pengine.c
|
|
|
1f016a |
index 2f7513f..35f35c6 100644
|
|
|
1f016a |
--- a/crmd/pengine.c
|
|
|
1f016a |
+++ b/crmd/pengine.c
|
|
|
1f016a |
@@ -277,6 +277,7 @@ force_local_option(xmlNode *xml, const char *attr_name, const char *attr_value)
|
|
|
1f016a |
|
|
|
1f016a |
free(attr_id);
|
|
|
1f016a |
}
|
|
|
1f016a |
+ freeXpathObject(xpathObj);
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
void
|
|
|
1f016a |
--
|
|
|
1f016a |
1.8.4.2
|
|
|
1f016a |
|