]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: deviceatlas: fix deinit to only finalize when initialized
authorDavid Carlier <dcarlier@deviceatlas.com>
Sat, 14 Feb 2026 13:24:02 +0000 (13:24 +0000)
committerWilly Tarreau <w@1wt.eu>
Sat, 14 Feb 2026 13:47:22 +0000 (14:47 +0100)
da_fini() was called unconditionally in deinit_deviceatlas() even when
da_init() was never called. Move it inside the daset check. Also remove
the erroneous shm_unlink() call which could affect the dadwsch shared
memory used by the scheduling process.

This should be backported to lower branches.

addons/deviceatlas/da.c

index cdd13a73dead80763d93e1de182cf964fd279580..d919fb7e5ff2d31990708526d984207ad6f24ef1 100644 (file)
@@ -253,15 +253,13 @@ static void deinit_deviceatlas(void)
                free(global_deviceatlas.cookiename);
                da_atlas_close(&global_deviceatlas.atlas);
                free(global_deviceatlas.atlasimgptr);
+               da_fini();
        }
 
        if (global_deviceatlas.atlasfd != -1) {
                munmap(global_deviceatlas.atlasmap, ATLASTOKSZ);
                close(global_deviceatlas.atlasfd);
-               shm_unlink(ATLASMAPNM);
        }
-
-       da_fini();
 }
 
 static void da_haproxy_checkinst(void)