summaryrefslogtreecommitdiff
path: root/networking/wget.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/wget.c')
-rw-r--r--networking/wget.c8
1 files changed, 8 insertions, 0 deletions
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;
}