projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a771e7c
)
nc: free lsa in server mode, we might be up for a long time
author
Denis Vlasenko
<vda.linux@googlemail.com>
Tue, 21 Apr 2009 23:51:43 +0000
(23:51 -0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Tue, 21 Apr 2009 23:51:43 +0000
(23:51 -0000)
networking/nc.c
patch
|
blob
|
history
diff --git
a/networking/nc.c
b/networking/nc.c
index 857d63570764a315ce8795c8a71b244266a62c5c..e64c998bcc0730dbedc08b281b33981cc1626d6a 100644
(file)
--- a/
networking/nc.c
+++ b/
networking/nc.c
@@
-111,12
+111,12
@@
int nc_main(int argc, char **argv)
/* If we didn't specify a port number,
* query and print it after listen() */
if (!lport) {
- socklen_t addrlen = lsa->len;
- getsockname(sfd, &lsa->u.sa, &addrlen);
+ getsockname(sfd, &lsa->u.sa, &lsa->len);
lport = get_nport(&lsa->u.sa);
fdprintf(2, "%d\n", ntohs(lport));
}
close_on_exec_on(sfd);
+ free(lsa);
accept_again:
cfd = accept(sfd, NULL, 0);
if (cfd < 0)