From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ismael Luceno <ismael@iodev.co.uk>
Subject: [PATCH] Fix anonymous connection_state pointer
Date: Mon, 15 Aug 2022 14:25:26 +0200

Origin: Source Mage GNU/Linux
Upstream-Status: Accepted [v5.12.1 v5.13.0]
Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
---
 src/capabilities.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/capabilities.c b/src/capabilities.c
index a3a31c1aec19..eba9f5042faa 100644
--- a/src/capabilities.c
+++ b/src/capabilities.c
@@ -206,7 +206,8 @@ static MHD_RESULT cap_http_handler(void *cls, struct MHD_Connection *connection,
    * round. The docs are not very specific on the issue. */
   if (*connection_state == NULL) {
     /* set to a random non-NULL pointer. */
-    *connection_state = &(int){44};
+    static int rnd_state = 44;
+    *connection_state = &rnd_state;
     return MHD_YES;
   }
   DEBUG(CAP_PLUGIN ": formatted response: %s", g_cap_json);
