diff mbox

nft: fix leak of iterators

Message ID 20130605124318.4391.43073.stgit@localhost
State Changes Requested
Headers show

Commit Message

Giuseppe Longo June 5, 2013, 12:43 p.m. UTC
This patch fix leak of iterators
Signed-off-by: Giuseppe Longo <giuseppelng@gmail.com>
---
 iptables/nft.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)


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

Patch

diff --git a/iptables/nft.c b/iptables/nft.c
index c18999b..0ded02d 100644
--- a/iptables/nft.c
+++ b/iptables/nft.c
@@ -1112,6 +1112,7 @@  next:
 		c = nft_chain_list_iter_next(iter);
 	}
 
+        nft_chain_list_iter_destroy(iter);
 	nft_chain_list_free(list);
 
 	return 1;
@@ -1200,6 +1201,7 @@  next:
 		r = nft_rule_list_iter_next(iter);
 	}
 
+        nft_chain_list_iter_destroy(list);
 	nft_rule_list_free(list);
 
 	/* the core expects 1 for success and 0 for error */
@@ -1278,6 +1280,7 @@  next:
 	}
 
 err:
+        nft_chain_list_iter_destroy(iter);
 	nft_chain_list_free(list);
 
 	/* the core expects 1 for success and 0 for error */
@@ -1391,6 +1394,7 @@  next:
 	}
 
 err:
+        nft_chain_list_iter_destroy(iter);
 	nft_chain_list_free(list);
 
 	/* chain not found */