mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-12 05:49:19 +03:00
Fix 1563546, plug possible memory leak.
svn path=/trunk/netsurf/; revision=3085
This commit is contained in:
parent
450d83769f
commit
9bb9194a7d
@ -730,6 +730,10 @@ bool urldb_add_url(const char *url)
|
||||
host = components.authority;
|
||||
else
|
||||
host++;
|
||||
if (!host) {
|
||||
url_destroy_components(&components);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* get port and remove from authority */
|
||||
colon = strrchr(host, ':');
|
||||
@ -754,13 +758,9 @@ bool urldb_add_url(const char *url)
|
||||
p = urldb_add_path(components.scheme, port, h,
|
||||
components.path ? components.path : "",
|
||||
components.query, components.fragment, url);
|
||||
if (!p) {
|
||||
return false;
|
||||
}
|
||||
|
||||
url_destroy_components(&components);
|
||||
|
||||
return true;
|
||||
return (p != NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user