Prevent use after free in cookie update

svn path=/trunk/netsurf/; revision=13365
This commit is contained in:
John Mark Bell 2012-01-02 13:20:11 +00:00
parent f91dcf7308
commit b5acf7db9d
1 changed files with 2 additions and 1 deletions

View File

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