From e2cb51b7b4dc0b33efc43478e1a30b65bc1d3669 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Tue, 23 Mar 2021 10:28:34 +0800 Subject: [PATCH] week4 reset values to NULL after free() --- week4/queue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/week4/queue.c b/week4/queue.c index 7b62294..bf08588 100644 --- a/week4/queue.c +++ b/week4/queue.c @@ -111,6 +111,7 @@ void DisplayQueue(Queue *queue) { void DestroyQueue(Queue *queue) { free(queue->values); /* reset values */ + queue->values = NULL; queue->counter = 0; queue->maxSize = 0; queue->front = 0;