knotc: memory leaks when parsing invalid config
invalid.conf:
template:
foo: bar
Detected leaks:
% libtool exec valgrind --leak-check=full ../../src/knotc -c invalid.conf reload
==32392== Memcheck, a memory error detector
==32392== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==32392== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==32392== Command: /home/fcelda/devel/knot/src/.libs/lt-knotc -c invalid.conf reload
==32392==
2015-05-26T12:38:34 error: invalid configuration file 'invalid.conf', line 2 (invalid item)
2015-05-26T12:38:34 critical: failed to load configuration file (invalid item)
==32392==
==32392== HEAP SUMMARY:
==32392== in use at exit: 3,166,016 bytes in 27 blocks
==32392== total heap usage: 1,292 allocs, 1,265 frees, 3,385,030 bytes allocated
==32392==
==32392== 10,626 (96 direct, 10,530 indirect) bytes in 1 blocks are definitely lost in loss record 14 of 16
==32392== at 0x4C29BCF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==32392== by 0x1168CC: conf_new (conf.c:107)
==32392== by 0x115543: main (knotc_main.c:534)
==32392==
==32392== 1,048,584 bytes in 1 blocks are possibly lost in loss record 15 of 16
==32392== at 0x4C29BCF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==32392== by 0x58B5575: mdb_midl_alloc (midl.c:105)
==32392== by 0x58B6C01: mdb_env_open (in /usr/lib64/liblmdb.so.0.0.0)
==32392== by 0x1589BD: dbase_open_env (namedb_lmdb.c:150)
==32392== by 0x157DDC: init (namedb_lmdb.c:205)
==32392== by 0x116A4F: conf_new (conf.c:137)
==32392== by 0x115543: main (knotc_main.c:534)
==32392==
==32392== LEAK SUMMARY:
==32392== definitely lost: 96 bytes in 1 blocks
==32392== indirectly lost: 10,530 bytes in 14 blocks
==32392== possibly lost: 1,048,584 bytes in 1 blocks
==32392== still reachable: 2,106,806 bytes in 11 blocks
==32392== suppressed: 0 bytes in 0 blocks
==32392== Reachable blocks (those to which a pointer was found) are not shown.
==32392== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==32392==
==32392== For counts of detected and suppressed errors, rerun with: -v
==32392== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)