coroparse: Fix memory leaks
Previously, when parsing error happened, parser callback data were not
freed. This was not a big problem when reload was not implemented, but
it might be problem with reload.
Solution is to add new callback type PARSER_CB_CLEANUP which is called
either on error or end of parsing if there is no error. Callback is
responsible for cleaning all allocated memory.
To make such callback work reliably, all variables must be set to NULL
on cleanup (example is data->subsys) and linked list must be
reinitialized.
Another source of possible leak is strdup of some keys in
(like totem.interface.bindnetaddr, but there is
more similar examples) without previously freeing it.
This is problem if bindnetaddr is defined multiple times.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>