diff --git a/c-cpp/06_linkedlist/single_list.c b/c-cpp/06_linkedlist/single_list.c index 6c12868..0c2d761 100644 --- a/c-cpp/06_linkedlist/single_list.c +++ b/c-cpp/06_linkedlist/single_list.c @@ -74,7 +74,7 @@ struct single_list** search(struct single_list_head* head, int target) void reverse(struct single_list_head* head) { - struct single_list_head tmp; + struct single_list_head tmp = {NULL}; struct single_list *elem; while (!is_empty(head)) {