Blob Blame History Raw
From 28fd339a4de2fa383fd8a887e570be542f170ac2 Mon Sep 17 00:00:00 2001
From: Christopher Horler <cshorler@googlemail.com>
Date: Mon, 8 Dec 2014 20:04:31 +0000
Subject: [PATCH] src: fix use after free

Fixes: https://bugzilla.netfilter.org/show_bug.cgi?id=990

Signed-off-by: Christopher Horler <cshorler@googlemail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit d48012fa7718195e3f897b01a36e4ba249aa6dfc)
---
 src/libnetfilter_cthelper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libnetfilter_cthelper.c b/src/libnetfilter_cthelper.c
index 297887040b20c..f8f58e6c9c5e8 100644
--- a/src/libnetfilter_cthelper.c
+++ b/src/libnetfilter_cthelper.c
@@ -113,11 +113,11 @@ void nfct_helper_free(struct nfct_helper *h)
 {
 	int i;
 
-	free(h);
 	for (i=0; i<NF_CT_HELPER_CLASS_MAX; i++) {
 		if (h->expect_policy[i])
 			free(h->expect_policy[i]);
 	}
+	free(h);
 }
 EXPORT_SYMBOL(nfct_helper_free);
 
-- 
2.34.1