]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: cleanup red-herring memleaks in parent of daemonizing fork 11436/head
authorChristian Hopps <chopps@labn.net>
Fri, 17 Jun 2022 06:04:51 +0000 (02:04 -0400)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sun, 19 Jun 2022 09:50:21 +0000 (09:50 +0000)
- The parent of the daemonizing fork reports memleaks for the early
northbound allocations (libyang). If these were real memleaks these
would show up in the child as well; however, ignoring all memleaks in
the parent of the fork is too hard a sale. Instead, spend some CPU
cycles cleaning up the allocations in the parent after the fork and
immeidatley prior to exiting the parent after the daemonizing fork.

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 1213e46bfd4aaf2897787b4dc03879d4d1b81fa6)

lib/libfrr.c

index 89bbe6de2ee269a4e30c25cb3cf30151254e9b7e..b3b24e1d3119541333fdb9674ea8de1e6745ed0e 100644 (file)
@@ -948,6 +948,8 @@ static void frr_daemonize(void)
        }
 
        close(fds[1]);
+       nb_terminate();
+       yang_terminate();
        frr_daemon_wait(fds[0]);
 }