1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

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

View File

@ -156,7 +156,11 @@ get_hsts_database (void)
home = home_dir (); home = home_dir ();
if (home) if (home)
return aprintf ("%s/.wget-hsts", home); {
char *dir = aprintf ("%s/.wget-hsts", home);
xfree(home);
return dir;
}
return NULL; return NULL;
} }
@ -1763,8 +1767,6 @@ outputting to a regular file.\n"));
#endif #endif
#ifdef HAVE_HSTS #ifdef HAVE_HSTS
hsts_store = NULL;
/* Load the HSTS database. /* Load the HSTS database.
Maybe all the URLs are FTP(S), in which case HSTS would not be needed, 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 but this is the best place to do it, and it shouldn't be a critical