summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiraj Kumar Goit <niraj.g@samsung.com>2016-02-22 20:04:56 +0530
committerNiraj Kumar Goit <niraj.g@samsung.com>2016-03-08 22:28:13 -0800
commitd568b78e8040f49eb81a7b781bf6016a1ed568ac (patch)
tree817cb17d82079a8bbeb8cf840234457bf45a145f
parentcf570f852323cbb268e7c035aa520015c398622a (diff)
downloadconnman-d568b78e8040f49eb81a7b781bf6016a1ed568ac.tar.gz
connman-d568b78e8040f49eb81a7b781bf6016a1ed568ac.tar.bz2
connman-d568b78e8040f49eb81a7b781bf6016a1ed568ac.zip
iptables: Fix memory leak
This patch free memory allocated to cbd by cb_data_new() when get_table() return NULL. Change-Id: Ifc40f97290c459d580f029f4cf8655d475fcd0ad Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
-rwxr-xr-xsrc/iptables.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/iptables.c b/src/iptables.c
index 8d583eae..dd1b2e63 100755
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -2364,8 +2364,10 @@ int __connman_iptables_iterate_chains(const char *table_name,
struct connman_iptables *table;
table = get_table(table_name);
- if (!table)
+ if (!table) {
+ g_free(cbd);
return -EINVAL;
+ }
iterate_entries(table->blob_entries->entrytable,
table->info->valid_hooks,