From b5acf7db9dd23107d61d237a25b6f51b5080d4b1 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 2 Jan 2012 13:20:11 +0000 Subject: [PATCH] Prevent use after free in cookie update svn path=/trunk/netsurf/; revision=13365 --- content/urldb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/urldb.c b/content/urldb.c index 8053f5094..4d206e720 100644 --- a/content/urldb.c +++ b/content/urldb.c @@ -2911,7 +2911,6 @@ bool urldb_set_cookie(const char *header, const char *url, /* Now insert into database */ if (!urldb_insert_cookie(c, scheme, urlt)) goto error; - cookies_schedule_update((struct cookie_data *)c); } while (cur < end); free(host); @@ -3393,6 +3392,8 @@ bool urldb_insert_cookie(struct cookie_internal_data *c, const char *scheme, else p->cookies = c; p->cookies_end = c; + + cookies_schedule_update((struct cookie_data *)c); } return true;