File 0001-Low-tools-Free-metadata-memory-in-crm_resource.patch of Package pacemaker.26120
From 8ffa388da2db07e696cec92eb1366deb8cd53141 Mon Sep 17 00:00:00 2001
From: Chris Lumens <clumens@redhat.com>
Date: Tue, 11 Jan 2022 13:47:00 -0500
Subject: [PATCH] Low: tools: Free metadata memory in crm_resource.
The string given to output_xml needs to be freed after use. libxml will
strdup it. We don't need to preserve a second copy.
---
tools/crm_resource.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/crm_resource.c b/tools/crm_resource.c
index 1b5c65405..b32d7b04b 100644
--- a/tools/crm_resource.c
+++ b/tools/crm_resource.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2021 the Pacemaker project contributors
+ * Copyright 2004-2022 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
@@ -1407,6 +1407,7 @@ show_metadata(pcmk__output_t *out, const char *agent_spec)
if (metadata) {
out->output_xml(out, "metadata", metadata);
+ free(metadata);
} else {
/* We were given a validly formatted spec, but it doesn't necessarily
* match up with anything that exists. Use ENXIO as the return code
--
2.34.1