misc/ss: fix memory leak in user_ent_hash_build()

Signed-off-by: Phil Sutter <phil@nwl.cc>
This commit is contained in:
Phil Sutter 2015-08-06 14:24:36 +02:00 committed by Stephen Hemminger
parent 5950ba914e
commit a02371fb38
1 changed files with 3 additions and 1 deletions

View File

@ -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;