[prev in list] [next in list] [prev in thread] [next in thread]
List: iptraf-ng
Subject: [PATCH 7/9] hostmon.c: simplify destroyethtab()
From: Vitezslav Samel <vitezslav () samel ! cz>
Date: 2014-06-12 13:42:17
Message-ID: 1402580539-18771-8-git-send-email-vitezslav () samel ! cz
[Download RAW message or body]
Signed-off-by: Vitezslav Samel <vitezslav@samel.cz>
---
src/hostmon.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/src/hostmon.c b/src/hostmon.c
index dc34a94..76ddb46 100644
--- a/src/hostmon.c
+++ b/src/hostmon.c
@@ -371,21 +371,16 @@ static void printethent(struct ethtab *table, struct ethtabent *entry)
static void destroyethtab(struct ethtab *table)
{
struct ethtabent *ptemp = table->head;
- struct ethtabent *cnext = NULL;
-
- if (table->head != NULL)
- cnext = table->head->next_entry;
while (ptemp != NULL) {
+ struct ethtabent *next = ptemp->next_entry;
+
if (ptemp->type == 1) {
rate_destroy(&ptemp->un.figs.outrate);
rate_destroy(&ptemp->un.figs.inrate);
}
free(ptemp);
- ptemp = cnext;
-
- if (cnext != NULL)
- cnext = cnext->next_entry;
+ ptemp = next;
}
}
--
1.9.1
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic