[PATCH 10/10] ss: fixed free on local array for valid json output
Minor fix to enable json output. Freeing of automatic char array name which will get freed after function stack cleanup. Another one after tcp_stats_fmt for freeing automatic tcpstats struct instance. Signed-off-by: Matthias Tafelmeier matthias.tafelme...@gmx.net Suggested-by: Hagen Paul Pfeifer ha...@jauu.net --- misc/ss.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/misc/ss.c b/misc/ss.c index 5eba08d..722253a 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -1664,10 +1664,6 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r, s.segs_out = info-tcpi_segs_out; s.segs_in = info-tcpi_segs_in; tcp_stats_fmt(s); - if (s.dctcp) - free(s.dctcp); - if (s.cong_alg) - free(s.cong_alg); } } @@ -2366,8 +2362,6 @@ if (show_mem) { if (json_output) printf(}\n); - if (name) - free(name); return 0; } -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 10/10] ss: fixed free on local array for valid json output
Minor fix to enable json output. Freeing of automatic char array name which will get freed after function stack cleanup. Another one after tcp_stats_fmt for freeing automatic tcpstats struct instance. Signed-off-by: Matthias Tafelmeier matthias.tafelme...@gmx.net Suggested-by: Hagen Paul Pfeifer ha...@jauu.net --- misc/ss.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/misc/ss.c b/misc/ss.c index 24f08d0..dc6e3f1 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -1665,10 +1665,6 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r, s.segs_out = info-tcpi_segs_out; s.segs_in = info-tcpi_segs_in; tcp_stats_fmt(s); - if (s.dctcp) - free(s.dctcp); - if (s.cong_alg) - free(s.cong_alg); } } @@ -2367,8 +2363,6 @@ if (show_mem) { printf(}\n); } - if (name) - free(name); return 0; } -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html