afh: Avoid memory leak at exit.
authorAndre Noll <maan@tuebingen.mpg.de>
Thu, 26 Aug 2021 17:31:25 +0000 (19:31 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 30 Aug 2021 18:36:10 +0000 (20:36 +0200)
We missed to free the lopsub parse result. This is not a real leak
because it's a one-off allocation and we are about to exit anyway. It's
worth to fix nevertheless, though, because with the patch applied,
valgrind says "no leaks are possible". Hence any other output means
we have introduced a new memory leak.

afh.c

diff --git a/afh.c b/afh.c
index 567b560a038f0923a663005b447a0fc688c57b2a..c896a7d1eff4a843e2e61a4ec8b6dac4982ed197 100644 (file)
--- a/afh.c
+++ b/afh.c
@@ -258,5 +258,6 @@ out:
                PARA_ERROR_LOG("%s\n", errctx);
        if (ret < 0)
                PARA_EMERG_LOG("%s\n", para_strerror(-ret));
                PARA_ERROR_LOG("%s\n", errctx);
        if (ret < 0)
                PARA_EMERG_LOG("%s\n", para_strerror(-ret));
+       lls_free_parse_result(lpr, CMD_PTR);
        return ret < 0? EXIT_FAILURE : EXIT_SUCCESS;
 }
        return ret < 0? EXIT_FAILURE : EXIT_SUCCESS;
 }