diff options
author | Rahul Jain <rahul.jain@samsung.com> | 2020-08-11 17:34:12 +0530 |
---|---|---|
committer | Rahul Jain <rahul.jain@samsung.com> | 2020-08-13 16:51:16 +0530 |
commit | 26dbdca524427fa4b1bbdecdc9d0e9351cdc830b (patch) | |
tree | 18acf97bda7ddd624cc90e926cd365283fb97864 | |
parent | 5f35f869119cb64a3f9ebb8972e901f3fd6f2807 (diff) | |
download | connman-26dbdca524427fa4b1bbdecdc9d0e9351cdc830b.tar.gz connman-26dbdca524427fa4b1bbdecdc9d0e9351cdc830b.tar.bz2 connman-26dbdca524427fa4b1bbdecdc9d0e9351cdc830b.zip |
Svace Fix: memory leak
Change-Id: Id10ede540b99d028f6ff40225b4dfcccb46d7fe0
-rwxr-xr-x | src/iptables.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/iptables.c b/src/iptables.c index 6b7f7efc..beb14df7 100755 --- a/src/iptables.c +++ b/src/iptables.c @@ -1573,14 +1573,25 @@ static GList *find_existing_rule(struct connman_iptables *table, switch (entry_test->type) { case AF_INET: - if (!entry_test->entry) + if (!entry_test->entry) { +#if defined TIZEN_EXT + iptables_entry_free(entry_test); +#endif return NULL; + } break; case AF_INET6: - if (!entry_test->entry6) + if (!entry_test->entry6) { +#if defined TIZEN_EXT + iptables_entry_free(entry_test); +#endif return NULL; + } break; default: +#if defined TIZEN_EXT + iptables_entry_free(entry_test); +#endif return NULL; } @@ -2458,8 +2469,13 @@ static struct connman_iptables *iptables_init(int type, const char *table_name) DBG("%d %s", type, table_name); - if (setup_xtables(type)) + if (setup_xtables(type)) { +#if defined TIZEN_EXT + g_free(iptables_mod); + g_free(module); +#endif return NULL; + } if (xtables_insmod(iptables_mod, NULL, TRUE) != 0) DBG("%s module loading gives error but trying anyway", |