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 ; }