File bsc#1181744-0008-Fix-st_client-cleanup-token-whenever-setting-api-to--1.1.patch of Package pacemaker.19778

From 926ae820d6406885dce8ba794215002b57bce17f Mon Sep 17 00:00:00 2001
From: Klaus Wenninger <klaus.wenninger@aon.at>
Date: Wed, 10 Jul 2019 17:57:02 +0200
Subject: [PATCH 8/8] Fix: st_client: cleanup token whenever setting api to
 disconnected

---
 lib/fencing/st_client.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/fencing/st_client.c b/lib/fencing/st_client.c
index feb8c73ae..60c07d574 100644
--- a/lib/fencing/st_client.c
+++ b/lib/fencing/st_client.c
@@ -273,6 +273,7 @@ stonith_connection_destroy(gpointer user_data)
     native->ipc = NULL;
     native->source = NULL;
 
+    free(native->token); native->token = NULL;
     stonith->state = stonith_disconnected;
     crm_xml_add(blob.xml, F_TYPE, T_STONITH_NOTIFY);
     crm_xml_add(blob.xml, F_SUBTYPE, T_STONITH_NOTIFY_DISCONNECT);
@@ -1975,6 +1976,7 @@ stonith_send_command(stonith_t * stonith, const char *op, xmlNode * data, xmlNod
   done:
     if (crm_ipc_connected(native->ipc) == FALSE) {
         crm_err("STONITH disconnected");
+        free(native->token); native->token = NULL;
         stonith->state = stonith_disconnected;
     }
 
-- 
2.26.2

openSUSE Build Service is sponsored by