[PATCH] define "i" only if attr is NFTNL_CHAIN_DEVICES. When attr isn't NFTNL_CHAIN_DEVICES, "i" is useless.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: shixuantong <tongxiaoge1001@xxxxxxx>

---
 src/chain.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/chain.c b/src/chain.c
index dcfcd04..eb2cba7 100644
--- a/src/chain.c
+++ b/src/chain.c
@@ -150,8 +150,6 @@ bool nftnl_chain_is_set(const struct nftnl_chain *c, uint16_t attr)
 EXPORT_SYMBOL(nftnl_chain_unset);
 void nftnl_chain_unset(struct nftnl_chain *c, uint16_t attr)
 {
-	int i;
-
 	if (!(c->flags & (1 << attr)))
 		return;
 
@@ -181,7 +179,7 @@ void nftnl_chain_unset(struct nftnl_chain *c, uint16_t attr)
 		xfree(c->dev);
 		break;
 	case NFTNL_CHAIN_DEVICES:
-		for (i = 0; i < c->dev_array_len; i++)
+		for (int i = 0; i < c->dev_array_len; i++)
 			xfree(c->dev_array[i]);
 		xfree(c->dev_array);
 		break;
-- 
2.33.0




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux