summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiraj Kumar Goit <niraj.g@samsung.com>2016-02-22 14:34:56 (GMT)
committerNiraj Kumar Goit <niraj.g@samsung.com>2016-03-09 06:28:13 (GMT)
commitd568b78e8040f49eb81a7b781bf6016a1ed568ac (patch)
tree817cb17d82079a8bbeb8cf840234457bf45a145f
parentcf570f852323cbb268e7c035aa520015c398622a (diff)
downloadconnman-d568b78e8040f49eb81a7b781bf6016a1ed568ac.zip
connman-d568b78e8040f49eb81a7b781bf6016a1ed568ac.tar.gz
connman-d568b78e8040f49eb81a7b781bf6016a1ed568ac.tar.bz2
iptables: Fix memory leakrefs/changes/36/60036/2
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 8d583ea..dd1b2e6 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,