summaryrefslogtreecommitdiff
path: root/src/stats-mode.c
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2008-01-17 17:16:54 +0000
committer/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2008-01-17 17:16:54 +0000
commit5c7db5abef470bc6a0f2e3858a5fc75731c9f3bd (patch)
tree09816bc288f987c2ef33d1594f94824b9a963bf9 /src/stats-mode.c
parentab4f7c0abd2d42f20b8675b3bc552a88204ce4ad (diff)
downloadconntrack-tools-5c7db5abef470bc6a0f2e3858a5fc75731c9f3bd.tar.gz
conntrack-tools-5c7db5abef470bc6a0f2e3858a5fc75731c9f3bd.zip
Max Kellermann <max@duempel.org>:
fix memory leaks in several error output paths
Diffstat (limited to 'src/stats-mode.c')
-rw-r--r--src/stats-mode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/stats-mode.c b/src/stats-mode.c
index 563e1f6..0c42d95 100644
--- a/src/stats-mode.c
+++ b/src/stats-mode.c
@@ -41,6 +41,7 @@ static int init_stats(void)
STATE_STATS(buffer_log) = buffer_create(CONFIG(stats).buffer_size);
if (!STATE_STATS(buffer_log)) {
dlog(STATE(log), LOG_ERR, "can't allocate stats buffer");
+ free(state.stats);
return -1;
}
@@ -51,6 +52,8 @@ static int init_stats(void)
if (!STATE_STATS(cache)) {
dlog(STATE(log), LOG_ERR, "can't allocate memory for the "
"external cache");
+ free(state.stats);
+ buffer_destroy(STATE_STATS(buffer_log));
return -1;
}