]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: errors: startup_logs_free: set global startup_logs ptr to NULL
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Mon, 28 Oct 2024 15:03:44 +0000 (16:03 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 29 Oct 2024 17:17:49 +0000 (18:17 +0100)
ring_free() calls free() on the ring struct pointer, but startup_logs continues
to keep this address. So let's reset at the end startup_logs to NULL.
startup_logs is checked in print_message().

No need to backport this fix, as it's related to the latest master-worker
refactoring.

src/errors.c

index 26e5fa0ab636feede96e0e9bf50c3e4a35ea7c53..201eece57b6ba1250debaf1478ad30186e672c99 100644 (file)
@@ -150,6 +150,7 @@ void startup_logs_free(struct ring *r)
                munmap(ring_allocated_area(r), STARTUP_LOG_SIZE);
 #endif /* ! USE_SHM_OPEN */
        ring_free(r);
+       startup_logs = NULL;
 }
 
 /* duplicate a startup logs which was previously allocated in a shm */