From b3dc802efb41d3d0484a469ab21f7bb637a3289c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de> Date: Thu, 27 Feb 2020 14:27:05 +0100 Subject: [PATCH] * src/cookies.c: Free PSL in cookie_jar_delete --- src/cookies.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/cookies.c b/src/cookies.c index 97d12b10..acc38f1a 100644 --- a/src/cookies.c +++ b/src/cookies.c @@ -527,14 +527,15 @@ numeric_address_p (const char *addr) upper case strings. */ +#ifdef HAVE_LIBPSL +static psl_ctx_t *psl; +#endif + static bool check_domain_match (const char *cookie_domain, const char *host) { - #ifdef HAVE_LIBPSL static int init_psl; - static const psl_ctx_t *psl; - char *cookie_domain_lower = NULL; char *host_lower = NULL; int is_acceptable; @@ -1443,6 +1444,10 @@ cookie_jar_delete (struct cookie_jar *jar) } hash_table_destroy (jar->chains); xfree (jar); + +#ifdef HAVE_LIBPSL + psl_free (psl); +#endif } /* Test cases. Currently this is only tests parse_set_cookies. To