File bsc#1211678-0001-Test-libpe_rules-libcrmcommon-Free-the-whole-xml-doc.patch of Package pacemaker.32052
From 4d41ff88e4def0a4129c79c9e478efacd71c24c6 Mon Sep 17 00:00:00 2001
From: Chris Lumens <clumens@redhat.com>
Date: Mon, 25 Jan 2021 11:04:57 -0500
Subject: [PATCH 1/6] Test: libpe_rules, libcrmcommon: Free the whole xml doc,
not just the node.
---
lib/common/output_xml.c | 2 +-
.../tests/rules/pe_cron_range_satisfied_test.c | 11 ++++++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/lib/common/output_xml.c b/lib/common/output_xml.c
index 005397943..2125640c9 100644
--- a/lib/common/output_xml.c
+++ b/lib/common/output_xml.c
@@ -82,7 +82,7 @@ xml_free_priv(pcmk__output_t *out) {
return;
}
- xmlFreeNode(priv->root);
+ free_xml(priv->root);
g_queue_free(priv->parent_q);
g_slist_free(priv->errors);
free(priv);
diff --git a/lib/pengine/tests/rules/pe_cron_range_satisfied_test.c b/lib/pengine/tests/rules/pe_cron_range_satisfied_test.c
index e1ac5f61e..9c56c0e77 100644
--- a/lib/pengine/tests/rules/pe_cron_range_satisfied_test.c
+++ b/lib/pengine/tests/rules/pe_cron_range_satisfied_test.c
@@ -1,3 +1,12 @@
+/*
+ * Copyright 2020-2021 the Pacemaker project contributors
+ *
+ * The version control history for this file may have further details.
+ *
+ * This source code is licensed under the GNU Lesser General Public License
+ * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
+ */
+
#include <glib.h>
#include <crm/common/xml.h>
@@ -11,7 +20,7 @@ run_one_test(const char *t, const char *x, int expected) {
g_assert_cmpint(pe_cron_range_satisfied(tm, xml), ==, expected);
crm_time_free(tm);
- xmlFreeNode(xml);
+ free_xml(xml);
}
static void
--
2.35.3