mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-03-12 01:53:09 +03:00
fix use after free on error path
This commit is contained in:
parent
82e2fc57d7
commit
2f03a0bfaf
@ -565,12 +565,12 @@ static void tree_url_load_entry(dom_node *li, tree_url_load_ctx *ctx)
|
||||
|
||||
error = nsurl_create(url2, &url);
|
||||
|
||||
free(url2);
|
||||
|
||||
if (error != NSERROR_OK) {
|
||||
LOG(("Failed normalising '%s'", url2));
|
||||
|
||||
warn_user("NoMemory", NULL);
|
||||
free(url2);
|
||||
|
||||
warn_user(messages_get_errorcode(error), NULL);
|
||||
|
||||
free(title);
|
||||
dom_node_unref(a);
|
||||
@ -578,6 +578,8 @@ static void tree_url_load_entry(dom_node *li, tree_url_load_ctx *ctx)
|
||||
return;
|
||||
}
|
||||
|
||||
free(url2);
|
||||
|
||||
data = urldb_get_url_data(url);
|
||||
if (data == NULL) {
|
||||
/* No entry in database, so add one */
|
||||
|
Loading…
x
Reference in New Issue
Block a user