From 67a647b88d699010f393227bdc5f25f8061ca9ce Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 2 Mar 2014 10:39:36 -0800 Subject: [PATCH] Fix bug in list. --- src/common/guac_list.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/guac_list.c b/src/common/guac_list.c index 517c9ec2..911b991b 100644 --- a/src/common/guac_list.c +++ b/src/common/guac_list.c @@ -66,7 +66,9 @@ void guac_common_list_remove(guac_common_list* list, /* Point previous (or head) to next */ *(element->_ptr) = element->next; - element->next->_ptr = element->_ptr; + + if (element->next != NULL) + element->next->_ptr = element->_ptr; free(element);