diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2017-10-31 18:47:55 +0100 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2017-11-01 22:10:52 +0100 |
commit | 22658ff53ab184bf446959fa0389717e82406b0d (patch) | |
tree | d459ac4541ba16ec539a61a251ffc660d3d91409 | |
parent | 38509fa903d66cf13f3c8ca5010db820fb874064 (diff) | |
download | iproute2-22658ff53ab184bf446959fa0389717e82406b0d.tar.gz |
ss: Streamline process context printing in netlink_show_one()
There's no need to check 'pid_context' before calling free().
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | misc/ss.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -3593,12 +3593,8 @@ static int netlink_show_one(struct filter *f, else if (pid > 0) getpidcon(pid, &pid_context); - if (pid_context != NULL) { - printf(" proc_ctx=%s", pid_context); - free(pid_context); - } else { - printf(" proc_ctx=unavailable"); - } + printf(" proc_ctx=%s", pid_context ? : "unavailable"); + free(pid_context); } if (show_details) { |