tools: Fix memory leaks and improve error handling.
authorJustus Winter <justus@g10code.com>
Tue, 10 Jan 2017 14:42:27 +0000 (15:42 +0100)
committerJustus Winter <justus@g10code.com>
Tue, 10 Jan 2017 14:42:27 +0000 (15:42 +0100)
commit1f5caf90bfaaaf7b9d8c06c12087aeeae3748032
treeebf14139e683a855225744a0a86422bc0e1eadd2
parentc8cfc62125aceee0ca48aab5c8a9fea1ec1ef652
tools: Fix memory leaks and improve error handling.

* tools/gpgconf-comp.c (gc_option_free): New function.
(gc_components_free): Likewise.
(gc_components_init): Likewise.
(retrieve_options_from_program): Use 'xfree', fix memory leak.
(change_options_program): Improve error handling.
(gc_component_change_options): Fix memory leaks.
* tools/gpgconf.c (main): Initialize components.
* tools/gpgconf.h (gc_components_init): New prototype.

Signed-off-by: Justus Winter <justus@g10code.com>
tools/gpgconf-comp.c
tools/gpgconf.c
tools/gpgconf.h