From ace33ff2c18c732e7ac30c49d95f7c35e06d7cee Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Fri, 4 Sep 2020 09:16:44 +0200 Subject: fix: Prüfe, ob 'data' wirklich dereferenziert werden kann MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- queue.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'queue.c') diff --git a/queue.c b/queue.c index e26acbb..2fb9c72 100644 --- a/queue.c +++ b/queue.c @@ -47,7 +47,10 @@ queue_get(struct queue *queue, T *data) { if ( queue->head != NULL ) { struct queue_item *next = queue->head->next; - *data = queue->head->data; + + if ( data != NULL ) { + *data = queue->head->data; + } free(queue->head); queue->head = next; -- cgit v1.3