Skip to content

Commit

Permalink
Always free proxy_auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Zhukov committed Aug 18, 2017
1 parent 19d62a8 commit 35e1425
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ncat/ncat_connect.c
Expand Up @@ -788,6 +788,8 @@ static int do_proxy_socks5(void)
goto error;
}

free(proxy_auth);

zmem(&socks5msg2,sizeof(socks5msg2));
socks5msg2.ver = SOCKS5_VERSION;
socks5msg2.cmd = SOCKS_CONNECT;
Expand Down Expand Up @@ -876,8 +878,7 @@ static int do_proxy_socks5(void)

return(sd);
error:
if (proxy_auth != NULL)
free(proxy_auth);
free(proxy_auth);
close(sd);
return -1;

Expand Down

0 comments on commit 35e1425

Please sign in to comment.