diff options
author | Niraj Kumar Goit <niraj.g@samsung.com> | 2016-02-22 20:04:56 +0530 |
---|---|---|
committer | Niraj Kumar Goit <niraj.g@samsung.com> | 2016-03-08 22:28:13 -0800 |
commit | d568b78e8040f49eb81a7b781bf6016a1ed568ac (patch) | |
tree | 817cb17d82079a8bbeb8cf840234457bf45a145f | |
parent | cf570f852323cbb268e7c035aa520015c398622a (diff) | |
download | connman-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-x | src/iptables.c | 4 |
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, |