File pacemaker#3380-0002-Low-libcrmcommon-Free-error-strings-in-html-xml-outp.patch of Package pacemaker.38495
From b1387fe85913c9733abbc4df7f5be0427dcd6be0 Mon Sep 17 00:00:00 2001
From: Chris Lumens <clumens@redhat.com>
Date: Thu, 29 Feb 2024 16:34:34 -0500
Subject: [PATCH 2/3] Low: libcrmcommon: Free error strings in html/xml
outputters.
These strings either get printed out or copied into XML nodes, so they
should be freed when we're done with them.
---
lib/common/output_html.c | 2 +-
lib/common/output_xml.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Index: pacemaker-2.1.7+20231219.0f7f88312/lib/common/output_html.c
===================================================================
--- pacemaker-2.1.7+20231219.0f7f88312.orig/lib/common/output_html.c
+++ pacemaker-2.1.7+20231219.0f7f88312/lib/common/output_html.c
@@ -83,7 +83,7 @@ html_free_priv(pcmk__output_t *out) {
xmlFreeNode(priv->root);
g_queue_free(priv->parent_q);
- g_slist_free(priv->errors);
+ g_slist_free_full(priv->errors, free);
free(priv);
out->priv = NULL;
}
Index: pacemaker-2.1.7+20231219.0f7f88312/lib/common/output_xml.c
===================================================================
--- pacemaker-2.1.7+20231219.0f7f88312.orig/lib/common/output_xml.c
+++ pacemaker-2.1.7+20231219.0f7f88312/lib/common/output_xml.c
@@ -96,7 +96,7 @@ xml_free_priv(pcmk__output_t *out) {
free_xml(priv->root);
g_queue_free(priv->parent_q);
- g_slist_free(priv->errors);
+ g_slist_free_full(priv->errors, free);
free(priv);
out->priv = NULL;
}