From: Stefano Brivio Date: Tue, 31 Oct 2017 17:47:55 +0000 (+0100) Subject: ss: Streamline process context printing in netlink_show_one() X-Git-Tag: v4.14.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22658ff53ab184bf446959fa0389717e82406b0d;p=thirdparty%2Fiproute2.git 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 --- diff --git a/misc/ss.c b/misc/ss.c index fa026eb09..fb80d8412 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -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) {