• R/O
  • SSH

pm_diskd: Commit

※ リポジトリは、pm-diskd ブランチが https://github.com/linux-ha-japan/pm_diskd-1.0 へ、pm-diskd-2.0ブランチが https://github.com/linux-ha-japan/pm_diskd へ移行しました。

Pacemaker 対応ディスク故障監視機能。

Pacemaker-1.0公式リポジトリのクローンに対し、パッチ作成用のブランチを作成して管理する。
ブランチ名: pm-diskd

初回 hg clone 実行後は、hg update -r pm-diskd を実行すること。

Heartbeat-2.1.4 用 hb-diskd(*) のPacemaker対応版
(*) http://sourceforge.jp/projects/linux-ha/releases/?package_id=10555


Commit MetaInfo

Revision8329dfdcc00bb86b3e680835eadd052ad173c28b (tree)
Time2010-03-29 17:50:37
AuthorKeisuke MORI <kskmori@inte...>
CommiterKeisuke MORI

Log Message

High: Core: fix memory leaks exposed by valgrind

Change Summary

Incremental Difference

diff -r b68428922445 -r 8329dfdcc00b lib/common/xml.c
--- a/lib/common/xml.c Tue Apr 13 10:51:03 2010 +0200
+++ b/lib/common/xml.c Mon Mar 29 17:50:37 2010 +0900
@@ -2653,7 +2653,9 @@
26532653 offset += snprintf(xpath_string + offset, xpath_max - offset, "//%s[@id='%s']", tag, ref);
26542654 result = get_xpath_object(xpath_string, top, LOG_ERR);
26552655 if(result == NULL) {
2656- crm_err("No match for %s found in %s: Invalid configuration", xpath_string, xmlGetNodePath(top));
2656+ char *nodePath = (char *)xmlGetNodePath(top);
2657+ crm_err("No match for %s found in %s: Invalid configuration", xpath_string, crm_str(nodePath));
2658+ crm_free(nodePath);
26572659 }
26582660 }
26592661
@@ -2667,13 +2669,13 @@
26672669 int len = 0;
26682670 xmlNode *result = NULL;
26692671 char *xpath_full = NULL;
2670- const char *xpath_prefix = NULL;
2672+ char *xpath_prefix = NULL;
26712673
26722674 if(xml_obj == NULL || xpath == NULL) {
26732675 return NULL;
26742676 }
26752677
2676- xpath_prefix = (const char *)xmlGetNodePath(xml_obj);
2678+ xpath_prefix = (char *)xmlGetNodePath(xml_obj);
26772679 len += strlen(xpath_prefix);
26782680 len += strlen(xpath);
26792681
@@ -2683,6 +2685,7 @@
26832685
26842686 result = get_xpath_object(xpath_full, xml_obj, error_level);
26852687
2688+ crm_free(xpath_prefix);
26862689 crm_free(xpath_full);
26872690 return result;
26882691 }
@@ -2692,25 +2695,30 @@
26922695 {
26932696 xmlNode *result = NULL;
26942697 xmlXPathObjectPtr xpathObj = NULL;
2698+ char *nodePath = NULL;
2699+ char *matchNodePath = NULL;
26952700
26962701 if(xpath == NULL) {
26972702 return xml_obj; /* or return NULL? */
26982703 }
26992704
27002705 xpathObj = xpath_search(xml_obj, xpath);
2706+ nodePath = (char *)xmlGetNodePath(xml_obj);
27012707 if(xpathObj == NULL || xpathObj->nodesetval == NULL || xpathObj->nodesetval->nodeNr < 1) {
2702- do_crm_log(error_level, "No match for %s in %s", xpath, xmlGetNodePath(xml_obj));
2708+ do_crm_log(error_level, "No match for %s in %s", xpath, crm_str(nodePath));
27032709 crm_log_xml(LOG_DEBUG_2, "Bad Input", xml_obj);
27042710
27052711 } else if(xpathObj->nodesetval->nodeNr > 1) {
27062712 int lpc = 0, max = xpathObj->nodesetval->nodeNr;
2707- do_crm_log(error_level, "Too many matches for %s in %s", xpath, xmlGetNodePath(xml_obj));
2713+ do_crm_log(error_level, "Too many matches for %s in %s", xpath, crm_str(nodePath));
27082714
27092715 for(lpc = 0; lpc < max; lpc++) {
27102716 xmlNode *match = getXpathResult(xpathObj, lpc);
27112717 CRM_CHECK(match != NULL, continue);
2712-
2713- do_crm_log(error_level, "%s[%d] = %s", xpath, lpc, xmlGetNodePath(match));
2718+
2719+ matchNodePath = (char *)xmlGetNodePath(match);
2720+ do_crm_log(error_level, "%s[%d] = %s", xpath, lpc, crm_str(matchNodePath));
2721+ crm_free(matchNodePath);
27142722 }
27152723 crm_log_xml(LOG_DEBUG_2, "Bad Input", xml_obj);
27162724
@@ -2721,6 +2729,8 @@
27212729 if(xpathObj) {
27222730 xmlXPathFreeObject(xpathObj);
27232731 }
2732+ crm_free(nodePath);
2733+
27242734 return result;
27252735 }
27262736
Show on old repository browser