]> git.ipfire.org Git - thirdparty/systemd.git/commit
journal/catalog: fix memory leaks
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 18 Feb 2016 22:37:17 +0000 (17:37 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 Feb 2016 00:39:09 +0000 (19:39 -0500)
commit06466a7f039240b4c75cd5920401a7699c263d6e
tree9491db92c04a71026fdad6408aea0f54363196ab
parent82501b3fc40dae2660a86ab07462f33fe26347ad
journal/catalog: fix memory leaks

Various buffers were lost because finish_item() either consumed
the buffer or allocated a new one (if an entry with the same key existed).
The caller would simply forget the buffer in either case.

Also add a check for the case when a valid identifier is followed by
an empty body. We should not allow this.

Also be more consistent in error handling and always print an error
message.
src/journal/catalog.c
src/journal/test-catalog.c