※ リポジトリは、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
Revision | 8329dfdcc00bb86b3e680835eadd052ad173c28b (tree) |
---|---|
Time | 2010-03-29 17:50:37 |
Author | Keisuke MORI <kskmori@inte...> |
Commiter | Keisuke MORI |
High: Core: fix memory leaks exposed by valgrind
@@ -2653,7 +2653,9 @@ | ||
2653 | 2653 | offset += snprintf(xpath_string + offset, xpath_max - offset, "//%s[@id='%s']", tag, ref); |
2654 | 2654 | result = get_xpath_object(xpath_string, top, LOG_ERR); |
2655 | 2655 | 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); | |
2657 | 2659 | } |
2658 | 2660 | } |
2659 | 2661 |
@@ -2667,13 +2669,13 @@ | ||
2667 | 2669 | int len = 0; |
2668 | 2670 | xmlNode *result = NULL; |
2669 | 2671 | char *xpath_full = NULL; |
2670 | - const char *xpath_prefix = NULL; | |
2672 | + char *xpath_prefix = NULL; | |
2671 | 2673 | |
2672 | 2674 | if(xml_obj == NULL || xpath == NULL) { |
2673 | 2675 | return NULL; |
2674 | 2676 | } |
2675 | 2677 | |
2676 | - xpath_prefix = (const char *)xmlGetNodePath(xml_obj); | |
2678 | + xpath_prefix = (char *)xmlGetNodePath(xml_obj); | |
2677 | 2679 | len += strlen(xpath_prefix); |
2678 | 2680 | len += strlen(xpath); |
2679 | 2681 |
@@ -2683,6 +2685,7 @@ | ||
2683 | 2685 | |
2684 | 2686 | result = get_xpath_object(xpath_full, xml_obj, error_level); |
2685 | 2687 | |
2688 | + crm_free(xpath_prefix); | |
2686 | 2689 | crm_free(xpath_full); |
2687 | 2690 | return result; |
2688 | 2691 | } |
@@ -2692,25 +2695,30 @@ | ||
2692 | 2695 | { |
2693 | 2696 | xmlNode *result = NULL; |
2694 | 2697 | xmlXPathObjectPtr xpathObj = NULL; |
2698 | + char *nodePath = NULL; | |
2699 | + char *matchNodePath = NULL; | |
2695 | 2700 | |
2696 | 2701 | if(xpath == NULL) { |
2697 | 2702 | return xml_obj; /* or return NULL? */ |
2698 | 2703 | } |
2699 | 2704 | |
2700 | 2705 | xpathObj = xpath_search(xml_obj, xpath); |
2706 | + nodePath = (char *)xmlGetNodePath(xml_obj); | |
2701 | 2707 | 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)); | |
2703 | 2709 | crm_log_xml(LOG_DEBUG_2, "Bad Input", xml_obj); |
2704 | 2710 | |
2705 | 2711 | } else if(xpathObj->nodesetval->nodeNr > 1) { |
2706 | 2712 | 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)); | |
2708 | 2714 | |
2709 | 2715 | for(lpc = 0; lpc < max; lpc++) { |
2710 | 2716 | xmlNode *match = getXpathResult(xpathObj, lpc); |
2711 | 2717 | 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); | |
2714 | 2722 | } |
2715 | 2723 | crm_log_xml(LOG_DEBUG_2, "Bad Input", xml_obj); |
2716 | 2724 |
@@ -2721,6 +2729,8 @@ | ||
2721 | 2729 | if(xpathObj) { |
2722 | 2730 | xmlXPathFreeObject(xpathObj); |
2723 | 2731 | } |
2732 | + crm_free(nodePath); | |
2733 | + | |
2724 | 2734 | return result; |
2725 | 2735 | } |
2726 | 2736 |