Commit 309f9cb causes problems with uninitialized values. For example:
valgrind --leak-check=full ./lnf_ex01_writer -n 100 -f pokus.nfdump
==28602== Memcheck, a memory error detector
==28602== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==28602== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==28602== Command: ./lnf_ex01_writer -n 100 -f pokus.nfdump
==28602==
==28602== Conditional jump or move depends on uninitialised value(s)
==28602== at 0x405D63: lnf_lookup_exporter (libnf.c:963)
==28602== by 0x406011: lnf_write (libnf.c:1040)
==28602== by 0x40216F: main (lnf_ex01_writer.c:145)
You probably forgot to clear rec->flags in the function lnf_rec_clear() in src/libnf.c, but I'm not sure if flags also don't have deeper meaning.