server: Deplete close on fork list on exit.
authorAndre Noll <maan@tuebingen.mpg.de>
Sat, 12 Aug 2017 19:32:28 +0000 (21:32 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 13 Mar 2018 02:28:10 +0000 (03:28 +0100)
commit659b46df9a49e0677fd7ff85a9842adac4abec84
treea7f7f27b5e9c057698b8167fdb8732ad36d5b0e2
parentced0c17d1a3ee0336dc7b35e69faff131dabecac
server: Deplete close on fork list on exit.

We empty the list in the command handler process by calling
close_listed_fds(), but the server process leaks the memory
allocated for the entries of the close on fork list.

This commit introduces deplete_close_on_fork_list() to empty the
list without closing any file descriptors. It is called from main()
to avoid the leak.

With the patch applied, valgrind --show-reachable=no no longer
complains about possibly lost blocks for the server process.
close_on_fork.c
close_on_fork.h
server.c