Browse Source

fixing the fix by @FlorianPalm

Stasik0 10 years ago
parent
commit
0740918725
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/util/ua_list.c

+ 6 - 2
src/util/ua_list.c

@@ -90,7 +90,9 @@ UA_Int32 UA_list_removeFirst(UA_list_List* list, UA_list_PayloadVisitor visitor)
 		}
 		UA_free(list->first);
 		list->first = temp;
-		temp->prev = UA_NULL;
+		if(temp){
+			temp->prev = UA_NULL;
+		}
 		list->size--;
 		if(list->size == 1){
 			list->last = temp;
@@ -111,7 +113,9 @@ UA_Int32 UA_list_removeLast(UA_list_List* list, UA_list_PayloadVisitor visitor){
 		}
 		UA_free(list->last);
 		list->last = temp;
-		temp->next = UA_NULL;
+		if(temp){
+			temp->next = UA_NULL;
+		}
 		list->size--;
 		if(list->size == 1){
 			list->first = temp;