Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
src/serv.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/src/serv.c b/src/serv.c
index 90bac8c..1dfd273 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -1338,17 +1338,10 @@ void removeaport(struct porttab **table)
void destroyporttab(struct porttab *table)
{
- struct porttab *ptemp = table;
- struct porttab *ctemp = NULL;
+ while (table != NULL) {
+ struct porttab *ptemp = table->next_entry;
- if (ptemp != NULL)
- ctemp = ptemp->next_entry;
-
- while (ptemp != NULL) {
- free(ptemp);
- ptemp = ctemp;
-
- if (ctemp != NULL)
- ctemp = ctemp->next_entry;
+ free(table);
+ table = ptemp;
}
}
--
1.8.4