aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-04-21 23:51:43 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-04-21 23:51:43 +0000
commit8ed1945a9161bae257c0d2570676177d0bdac5fc (patch)
tree467de3b040dbd83aee5e362f521d013bfef01e43
parenta771e7c0057d0f506f8cdf67be39268e1c9f0735 (diff)
downloadbusybox-8ed1945a9161bae257c0d2570676177d0bdac5fc.tar.gz
nc: free lsa in server mode, we might be up for a long time
-rw-r--r--networking/nc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/nc.c b/networking/nc.c
index 857d63570..e64c998bc 100644
--- 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)