From d568b78e8040f49eb81a7b781bf6016a1ed568ac Mon Sep 17 00:00:00 2001 From: Niraj Kumar Goit Date: Mon, 22 Feb 2016 20:04:56 +0530 Subject: 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 --- src/iptables.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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, -- cgit v1.2.3