projects
/
profile
/
ivi
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f2161c2
)
tools: Fix memory leak in iptables-test.c
author
Tomasz Bursztyka
<tomasz.bursztyka@linux.intel.com>
Thu, 22 Sep 2011 12:39:24 +0000
(15:39 +0300)
committer
Samuel Ortiz
<sameo@linux.intel.com>
Thu, 22 Sep 2011 13:22:46 +0000
(15:22 +0200)
tools/iptables-test.c
patch
|
blob
|
history
diff --git
a/tools/iptables-test.c
b/tools/iptables-test.c
index
e97379e
..
c1d4f86
100644
(file)
--- a/
tools/iptables-test.c
+++ b/
tools/iptables-test.c
@@
-628,7
+628,7
@@
connman_iptables_add_rule(struct connman_iptables *table,
GList *chain_tail, *chain_head;
struct ipt_entry *new_entry;
struct connman_iptables_entry *head;
- int builtin = -1;
+ int builtin = -1
, ret
;
chain_head = find_chain_head(table, chain_name);
if (chain_head == NULL)
@@
-659,7
+659,11
@@
connman_iptables_add_rule(struct connman_iptables *table,
head->builtin = -1;
}
- return connman_add_entry(table, new_entry, chain_tail->prev, builtin);
+ ret = connman_add_entry(table, new_entry, chain_tail->prev, builtin);
+ if (ret < 0)
+ g_free(new_entry);
+
+ return ret;
}
static struct ipt_replace *