git: 9bfbc6826f72 - main - sockstat: fix the -j option with piped output after libxo integration
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 09 Sep 2025 16:45:42 UTC
The branch main has been updated by asomers:
URL: https://cgit.FreeBSD.org/src/commit/?id=9bfbc6826f72eb385bf52f4cde8080bccf7e3ebd
commit 9bfbc6826f72eb385bf52f4cde8080bccf7e3ebd
Author: Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2025-09-09 16:29:34 +0000
Commit: Alan Somers <asomers@FreeBSD.org>
CommitDate: 2025-09-09 16:45:17 +0000
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 since 0726c6574f8
(sockstat: Add automatic column sizing and remove -w option)
Fixes: 7b35b4d1963 (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
---
usr.bin/sockstat/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/usr.bin/sockstat/main.c b/usr.bin/sockstat/main.c
index b5e0248b743a..2e75e4966d80 100644
--- a/usr.bin/sockstat/main.c
+++ b/usr.bin/sockstat/main.c
@@ -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)