50b48147c0
The two memory leaks were found with the test suite running in --enable-valgrind mode - here are the relevant error messages: For fwknopd server GPG clean up: ==345== 9 bytes in 1 blocks are definitely lost in loss record 2 of 2 ==345== at 0x4C2815C: malloc (vg_replace_malloc.c:236) ==345== by 0x52F6B81: strdup (strdup.c:43) ==345== by 0x10FA57: add_string_list_ent (access.c:308) ==345== by 0x110513: parse_access_file (access.c:387) ==345== by 0x10B5FB: main (fwknopd.c:193) For fwknop client rc file processing: ==8045== 568 bytes in 1 blocks are still reachable in loss record 12 of 12 ==8045== at 0x4C2815C: malloc (vg_replace_malloc.c:236) ==8045== by 0x50A53AA: __fopen_internal (iofopen.c:76) ==8045== by 0x10C3FF: process_rc (config_init.c:446) ==8045== by 0x10C8F6: config_init (config_init.c:671) ==8045== by 0x10AC9E: main (fwknop.c:62) There is also a new clean_exit() function that makes it easier to ensure that resources are deallocated upon existing.