From 3a38d2bc1eaa1aa21eacf97ce2430d95df871f27 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Mon, 22 Aug 2011 21:38:58 +0200 Subject: [PATCH] [UDP-HTTP] Improve free_results_list() --- owlps-udp-to-http/owlps-udp-to-http.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/owlps-udp-to-http/owlps-udp-to-http.c b/owlps-udp-to-http/owlps-udp-to-http.c index 5fb9cd8..c83125d 100644 --- a/owlps-udp-to-http/owlps-udp-to-http.c +++ b/owlps-udp-to-http/owlps-udp-to-http.c @@ -496,11 +496,14 @@ void realloc_answer(size_t new_size) */ void free_results_list() { - results_list *ptr = results ; - while (ptr != NULL) + while (results != NULL) { - owl_free_result(ptr->result) ; - ptr = ptr->next ; + owl_free_result(results->result) ; + results = results->next ; +#ifndef NDEBUG + --nb_results ; +#endif // NDEBUG } + assert(nb_results == 0) ; nb_results = 0 ; }