mirror of
https://github.com/nmap/nmap.git
synced 2026-01-19 04:39:01 +00:00
Enfore node=NULL on error.
This commit is contained in:
@@ -361,7 +361,7 @@ static struct proxy_node *proxy_node_new(char *proxystr) {
|
||||
|
||||
pxop = ProxyBackends[i];
|
||||
if (strncasecmp(proxystr, pxop->prefix, strlen(pxop->prefix)) == 0) {
|
||||
struct proxy_node *proxy;
|
||||
struct proxy_node *proxy = NULL;
|
||||
struct uri uri;
|
||||
|
||||
memset(&uri, 0x00, sizeof(struct uri));
|
||||
@@ -369,7 +369,9 @@ static struct proxy_node *proxy_node_new(char *proxystr) {
|
||||
if (parse_uri(proxystr, &uri) < 0)
|
||||
break;
|
||||
|
||||
pxop->node_new(&proxy, &uri);
|
||||
if (pxop->node_new(&proxy, &uri) < 0)
|
||||
proxy = NULL;
|
||||
|
||||
uri_free(&uri);
|
||||
|
||||
return proxy;
|
||||
|
||||
@@ -86,6 +86,7 @@ int proxy_http_node_new(struct proxy_node **node, const struct uri *uri) {
|
||||
|
||||
if (proxy_resolve(uri->host, (struct sockaddr *)&proxy->ss, &proxy->sslen) < 0) {
|
||||
free(proxy);
|
||||
*node = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user