summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/iptables.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/iptables.c b/src/iptables.c
index 9e7f7175..8f8ab53c 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -450,7 +450,7 @@ static int iptables_add_chain(struct connman_iptables *table,
sizeof(struct error_target);
entry_head = g_try_malloc0(entry_head_size);
if (entry_head == NULL)
- goto err;
+ goto err_head;
memset(entry_head, 0, entry_head_size);
@@ -463,7 +463,7 @@ static int iptables_add_chain(struct connman_iptables *table,
strcpy(error->error, name);
if (iptables_add_entry(table, entry_head, last, -1) < 0)
- goto err;
+ goto err_head;
/* tail entry */
entry_return_size = sizeof(struct ipt_entry) +
@@ -488,8 +488,9 @@ static int iptables_add_chain(struct connman_iptables *table,
return 0;
err:
- g_free(entry_head);
g_free(entry_return);
+err_head:
+ g_free(entry_head);
return -ENOMEM;
}