From a02371fb3831c8d3d9d53209f2389b250a1fb804 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 6 Aug 2015 14:24:36 +0200 Subject: [PATCH] misc/ss: fix memory leak in user_ent_hash_build() Signed-off-by: Phil Sutter --- misc/ss.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/ss.c b/misc/ss.c index 90c2eda4e..2f3496228 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.47.2