From 670eb924e75730ed612e0f8b96a8bcd17d392d3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Tue, 4 Aug 2015 17:41:54 +0200 Subject: [PATCH] Fix memory leak in HSTS code * src/main.c (get_hsts_database): Free 'home' variable --- src/main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 64907119..9e52bcdb 100644 --- a/src/main.c +++ b/src/main.c @@ -156,7 +156,11 @@ get_hsts_database (void) home = home_dir (); if (home) - return aprintf ("%s/.wget-hsts", home); + { + char *dir = aprintf ("%s/.wget-hsts", home); + xfree(home); + return dir; + } return NULL; } @@ -1763,8 +1767,6 @@ outputting to a regular file.\n")); #endif #ifdef HAVE_HSTS - hsts_store = NULL; - /* Load the HSTS database. Maybe all the URLs are FTP(S), in which case HSTS would not be needed, but this is the best place to do it, and it shouldn't be a critical