X-Git-Url: https://git.wirehaze.ovh/ppos.git/blobdiff_plain/2d4748477a9b5599a0ca9d2dc8a97fc553c9b002..51bba96d7dec4cbd44e5000dc7043a992ab8c3da:/queue/queue.c diff --git a/queue/queue.c b/queue/queue.c index e54cb5e..1f5d3a7 100644 --- a/queue/queue.c +++ b/queue/queue.c @@ -52,18 +52,14 @@ queue_destroy (struct queue_t *queue) return ERROR; } - if (!(n = queue->head)) - { - free (queue); - return NOERROR; - } + n = queue->head; - do + while (n) { next = n->next; node_destroy (n); + n = next; } - while ((n = next)); free (queue); return NOERROR;