[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1438863876-1935-6-git-send-email-phil@nwl.cc>
Date: Thu, 6 Aug 2015 14:24:36 +0200
From: Phil Sutter <phil@....cc>
To: Stephen Hemminger <shemming@...cade.com>
Cc: netdev@...r.kernel.org
Subject: [PATCH 6/6] misc/ss: fix memory leak in user_ent_hash_build()
Signed-off-by: Phil Sutter <phil@....cc>
---
misc/ss.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/misc/ss.c b/misc/ss.c
index 0c7c6d7..bba7009 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -483,8 +483,10 @@ static void user_ent_hash_build(void)
sprintf(name + nameoff, "%d/fd/", pid);
pos = strlen(name);
- if ((dir1 = opendir(name)) == NULL)
+ if ((dir1 = opendir(name)) == NULL) {
+ free(pid_context);
continue;
+ }
process[0] = '\0';
p = process;
--
2.1.2
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists