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>
This commit is contained in:
Stefano Brivio 2017-10-31 18:47:55 +01:00 committed by Stephen Hemminger
parent 38509fa903
commit 22658ff53a
1 changed files with 2 additions and 6 deletions

View File

@ -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) {