From 840ef17f63c85044c15d9a38a13c6539e26dfc31 Mon Sep 17 00:00:00 2001 From: Guilherme Maciel Ferreira Date: Wed, 16 Oct 2013 14:43:30 +0200 Subject: wget: if FEATURE_CLEAN_UP, free(ptr_to_globals) Signed-off-by: Guilherme Maciel Ferreira Signed-off-by: Denys Vlasenko --- networking/wget.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'networking') diff --git a/networking/wget.c b/networking/wget.c index a32f852..cfbacec 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -89,6 +89,9 @@ struct globals { #define INIT_G() do { \ SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ } while (0) +#define FINI_G() do { \ + FREE_PTR_TO_GLOBALS(); \ +} while (0) /* Must match option string! */ @@ -1013,5 +1016,10 @@ int wget_main(int argc UNUSED_PARAM, char **argv) if (G.output_fd >= 0) xclose(G.output_fd); +#if ENABLE_FEATURE_CLEAN_UP && ENABLE_FEATURE_WGET_LONG_OPTIONS + free(G.extra_headers); +#endif + FINI_G(); + return EXIT_SUCCESS; } -- cgit v1.1