X-Git-Url: https://git.wirehaze.ovh/ppos.git/blobdiff_plain/61ce152bba6af0e2c2b15c99d50a3b2fc81d4aad..51bba96d7dec4cbd44e5000dc7043a992ab8c3da:/queue/queue.c?ds=sidebyside 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;