← Commit list

8ed1945a9

Denis Vlasenko
Denis Vlasenko
2009-04-21
FAILED Duration: 34s

Subject

nc: free lsa in server mode, we might be up for a long time

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

networking/nc.c+2 -2
@@ -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)