auparse: flush feed and release memory

This might produce some bad data if lines of data in input feed is incorrectly split
This commit is contained in:
Aleksei Nikiforov 2020-01-27 17:06:42 +03:00
parent d8bde76fd2
commit 3f295f3e05

View File

@ -1020,6 +1020,10 @@ int main(int argc, char **argv)
if (readsize > 0) if (readsize > 0)
{ {
auparse_feed(au.get(), data, readsize); auparse_feed(au.get(), data, readsize);
// assume that data wasn't split, and flush it
// otherwise, libauparse keeps increasing it's memory footprint
auparse_flush_feed(au.get());
} }
else else
{ {