From 755f16877dc29e46c8910fb5d431eaaa3be2aa10 Mon Sep 17 00:00:00 2001 From: ergz Date: Sat, 15 Jul 2023 11:34:31 -0700 Subject: [PATCH] forgot to add a subtraction in length of the node --- c/breadth-first-search.c | 1 + 1 file changed, 1 insertion(+) diff --git a/c/breadth-first-search.c b/c/breadth-first-search.c index 79be5db..5baddde 100644 --- a/c/breadth-first-search.c +++ b/c/breadth-first-search.c @@ -81,6 +81,7 @@ void q_add_node(Q* q, QNode* node) { void q_remove_node(Q* q) { QNode* n = q->head; q->head = n->next; + q->length--; free(n); }