summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2015-08-18 18:56:51 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2015-08-18 19:22:06 +0200
commitbe691dc236610ab349c3bffb9a891613f75c6ebe (patch)
treebe9923530d9ed4e0d1797671911872eab34d4ceb
parentcf2c6ea6cf1dd2753c431374284e148aba55f947 (diff)
downloadconntrack-tools-be691dc236610ab349c3bffb9a891613f75c6ebe.tar.gz
conntrack-tools-be691dc236610ab349c3bffb9a891613f75c6ebe.zip
conntrackd: fix leak in fork_process_new()
Release the child_process structure in case that fork() fails. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/process.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c
index 7f0a395..3ddad5f 100644
--- a/src/process.c
+++ b/src/process.c
@@ -48,6 +48,8 @@ int fork_process_new(int type, int flags, void (*cb)(void *data), void *data)
if (c->pid > 0)
list_add(&c->head, &process_list);
+ else
+ free(c);
return pid;
}