mirror of
https://github.com/sheumann/hush.git
synced 2025-01-18 07:31:34 +00:00
nc: free lsa in server mode, we might be up for a long time
This commit is contained in:
parent
a771e7c005
commit
8ed1945a91
@ -111,12 +111,12 @@ int nc_main(int argc, char **argv)
|
|||||||
/* If we didn't specify a port number,
|
/* If we didn't specify a port number,
|
||||||
* query and print it after listen() */
|
* query and print it after listen() */
|
||||||
if (!lport) {
|
if (!lport) {
|
||||||
socklen_t addrlen = lsa->len;
|
getsockname(sfd, &lsa->u.sa, &lsa->len);
|
||||||
getsockname(sfd, &lsa->u.sa, &addrlen);
|
|
||||||
lport = get_nport(&lsa->u.sa);
|
lport = get_nport(&lsa->u.sa);
|
||||||
fdprintf(2, "%d\n", ntohs(lport));
|
fdprintf(2, "%d\n", ntohs(lport));
|
||||||
}
|
}
|
||||||
close_on_exec_on(sfd);
|
close_on_exec_on(sfd);
|
||||||
|
free(lsa);
|
||||||
accept_again:
|
accept_again:
|
||||||
cfd = accept(sfd, NULL, 0);
|
cfd = accept(sfd, NULL, 0);
|
||||||
if (cfd < 0)
|
if (cfd < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user