Fix memory leak in HSTS code

* src/main.c (get_hsts_database): Free 'home' variable
This commit is contained in:
Tim Rühsen 2015-08-04 17:41:54 +02:00
parent 5d55018ce6
commit 670eb924e7
1 changed files with 5 additions and 3 deletions

View File

@ -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