From 83c71f78bfda87fbed9aca13c3fef2605fe0ce7b Mon Sep 17 00:00:00 2001 From: Kalle Valo Date: Mon, 7 Feb 2011 15:33:56 +0200 Subject: [PATCH] iptables: Fix uninitialised use of entry_return MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit src/iptables.c:432:20: error: ‘entry_return’ may be used uninitialized in this function --- src/iptables.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/iptables.c b/src/iptables.c index 9e7f717..8f8ab53 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; } -- 2.7.4