diff options
author | Thomas Graf <tgraf@suug.ch> | 2014-08-24 20:44:53 +0200 |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2014-08-24 20:44:53 +0200 |
commit | 22c83ceb1a089c1af9a8d1707fc92d84388d465b (patch) | |
tree | 4f296b8bb147c2da9f1e54e2e4e76d64fb63cb7a | |
parent | 279865c18d8ff3e4d732e1932ccf5d58d6a79a29 (diff) |
proc: Fix leakage of fd if element lookup failed
Fixes: CID 49002
Signed-off-by: Thomas Graf <tgraf@suug.ch>
-rw-r--r-- | src/in_proc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/in_proc.c b/src/in_proc.c index 245cd6b..1ba038f 100644 --- a/src/in_proc.c +++ b/src/in_proc.c @@ -151,7 +151,7 @@ static void proc_read(void) continue; if (!(e = element_lookup(grp, p, 0, NULL, ELEMENT_CREAT))) - return; + goto skip; if (e->e_flags & ELEMENT_FLAG_CREATED) { if (element_set_key_attr(e, "bytes", "packets") || @@ -171,7 +171,7 @@ static void proc_read(void) element_notify_update(e, NULL); element_lifesign(e, 1); } - +skip: fclose(fd); } |