Signed-off-by: Vitezslav Samel <vitezslav(a)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