[libnetfilter_log patch] Fix minor memory leak.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The nflog_handle is allocated in nflog_open(). This patch adds the missing
free in nlog_close().

Signed-off-by: Eric Leblond <eric@xxxxxx>
---
 src/libnetfilter_log.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/libnetfilter_log.c b/src/libnetfilter_log.c
index 6c0936e..216cdb8 100644
--- a/src/libnetfilter_log.c
+++ b/src/libnetfilter_log.c
@@ -237,7 +237,9 @@ int nflog_handle_packet(struct nflog_handle *h, char *buf, int len)
 
 int nflog_close(struct nflog_handle *h)
 {
-	return nfnl_close(h->nfnlh);
+	int ret = nfnl_close(h->nfnlh);
+	free(h);
+	return ret;
 }
 
 /* bind nf_queue from a specific protocol family */
-- 
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux