summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-03-16 13:45:25 +0100
committerDaniel Borkmann <dborkman@redhat.com>2013-03-16 13:45:25 +0100
commit2df71cfbeea516523894ad63be9da5c1839ef082 (patch)
tree959b9da1fd4ecc7882df68da6b7a636c7e5dd5f3
parentc69b4960fa4f48fcc7bd320bc34e4fc8de613bdc (diff)
flowtop: close dir handle first before returning back
Coverty detected that the variable "dir" going out of scope leaks the storage it points to. Thus close the handle first! Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
-rw-r--r--flowtop.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/flowtop.c b/flowtop.c
index 5418aaf..baa0964 100644
--- a/flowtop.c
+++ b/flowtop.c
@@ -428,6 +428,7 @@ static int walk_process(char *process, struct flow_entry *n)
panic("readlink error: %s\n", strerror(errno));
n->procnum = atoi(process);
+ closedir(dir);
return 1;
}
}