Fix 1563546, plug possible memory leak.

svn path=/trunk/netsurf/; revision=3085
This commit is contained in:
Richard Wilson 2006-12-01 18:38:04 +00:00
parent 450d83769f
commit 9bb9194a7d
1 changed files with 5 additions and 5 deletions

View File

@ -730,6 +730,10 @@ bool urldb_add_url(const char *url)
host = components.authority; host = components.authority;
else else
host++; host++;
if (!host) {
url_destroy_components(&components);
return false;
}
/* get port and remove from authority */ /* get port and remove from authority */
colon = strrchr(host, ':'); colon = strrchr(host, ':');
@ -754,13 +758,9 @@ bool urldb_add_url(const char *url)
p = urldb_add_path(components.scheme, port, h, p = urldb_add_path(components.scheme, port, h,
components.path ? components.path : "", components.path ? components.path : "",
components.query, components.fragment, url); components.query, components.fragment, url);
if (!p) {
return false;
}
url_destroy_components(&components); url_destroy_components(&components);
return (p != NULL);
return true;
} }
/** /**