sockstat: fix the -j option with piped output after libxo integration
The legacy code handling -j in display() was causing xo_finish() to be skipped. It has also been causing a memory leak since0726c6574f(sockstat: Add automatic column sizing and remove -w option) Fixes:7b35b4d196(sockstat: add libxo support) MFC after: 1 week Reported by: glebius Reviewed by: glebius Sponsored by: ConnectWise Pull Request: https://github.com/freebsd/freebsd-src/pull/1842
This commit is contained in:
@@ -1612,7 +1612,7 @@ display(void)
|
||||
}
|
||||
}
|
||||
if (opt_j >= 0)
|
||||
return;
|
||||
goto out;
|
||||
SLIST_FOREACH(s, &nosocks, socket_list) {
|
||||
if (!check_ports(s))
|
||||
continue;
|
||||
@@ -1637,6 +1637,7 @@ display(void)
|
||||
display_sock(s, &cw, buf, bufsize);
|
||||
xo_close_instance("socket");
|
||||
}
|
||||
out:
|
||||
xo_close_list("socket");
|
||||
xo_close_container("sockstat");
|
||||
if (xo_finish() < 0)
|
||||
|
||||
Reference in New Issue
Block a user