]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: checks: deinit checks_fe upon deinit
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 10 Apr 2025 14:24:57 +0000 (16:24 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 10 Apr 2025 20:10:31 +0000 (22:10 +0200)
This is just to make valgrind and friends happy, leverage deinit_proxy()
for checks_fe proxy upon deinit to ensure proper cleanup.

We check the presence of proxy->id to know if it was initialized because
we cannot rely on a pointer for that.

src/check.c

index 77c3ad59b50a5e21f6fe9848b1c71c9d75f99110..4ebf8d9379d490803dae18563a44148f386ebed8 100644 (file)
@@ -1746,6 +1746,12 @@ static int start_checks()
        return ERR_NONE;
 }
 
+/* called during deinit */
+static void clear_checks()
+{
+       if (checks_fe.id)
+               deinit_proxy(&checks_fe);
+}
 
 /*
  * Return value:
@@ -1998,6 +2004,7 @@ REGISTER_POST_CHECK(start_checks);
 
 REGISTER_SERVER_DEINIT(deinit_srv_check);
 REGISTER_SERVER_DEINIT(deinit_srv_agent_check);
+REGISTER_POST_DEINIT(clear_checks);
 
 /* perform minimal initializations */
 static void init_checks()