fix use after free on error path

This commit is contained in:
Vincent Sanders 2013-05-01 22:32:28 +01:00
parent 82e2fc57d7
commit 2f03a0bfaf

View File

@ -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 */