mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Enfore node=NULL on error.
This commit is contained in:
parent
8902a7c1bb
commit
5906c97ff9
2 changed files with 5 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue