diff --git a/plates/linkedlists/a.out b/plates/linkedlists/a.out deleted file mode 100755 index 580121a..0000000 Binary files a/plates/linkedlists/a.out and /dev/null differ diff --git a/plates/linkedlists/singlelist.cpp b/plates/linkedlists/singlelist.cpp index c9f4a61..6f0224b 100644 --- a/plates/linkedlists/singlelist.cpp +++ b/plates/linkedlists/singlelist.cpp @@ -130,8 +130,10 @@ bool SingleList::replace(int val, int key) */ void SingleList::makeEmpty() { - Node *nextNode = head->next; - Node *temp; + Node *nextNode, *temp; + + if (head == NULL) return; + nextNode = head->next; delete head; head = NULL; while(nextNode != NULL) {