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);