]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
charon-cmd: Register atexit() handler for libcharon_deinit twice
authorTobias Brunner <tobias@strongswan.org>
Thu, 6 Dec 2018 14:01:52 +0000 (15:01 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 7 Dec 2018 09:30:08 +0000 (10:30 +0100)
Similar to cbe9e575eef5, this avoids issues with libraries that are
pulled in via plugins and register their own atexit() handlers.

src/charon-cmd/charon-cmd.c

index 82bc3ee8457644602f83f047768137b009636cf7..e85e21d5c7353915e1c5f9ce3bb9d2ce450d3e3c 100644 (file)
@@ -348,6 +348,9 @@ int main(int argc, char *argv[])
        {
                exit(SS_RC_INITIALIZATION_FAILED);
        }
+       /* register this again after loading plugins to avoid issues with libraries
+        * that register atexit() handlers */
+       atexit(libcharon_deinit);
        if (!lib->caps->drop(lib->caps))
        {
                exit(SS_RC_INITIALIZATION_FAILED);