diff options
Diffstat (limited to 'queue.c')
| -rw-r--r-- | queue.c | 5 |
1 files changed, 4 insertions, 1 deletions
| @@ -47,7 +47,10 @@ queue_get(struct queue *queue, T *data) | |||
| 47 | { | 47 | { |
| 48 | if ( queue->head != NULL ) { | 48 | if ( queue->head != NULL ) { |
| 49 | struct queue_item *next = queue->head->next; | 49 | struct queue_item *next = queue->head->next; |
| 50 | *data = queue->head->data; | 50 | |
| 51 | if ( data != NULL ) { | ||
| 52 | *data = queue->head->data; | ||
| 53 | } | ||
| 51 | free(queue->head); | 54 | free(queue->head); |
| 52 | queue->head = next; | 55 | queue->head = next; |
| 53 | 56 | ||
