소스 검색

Fixed nasty bug on fixed lists: Empty fixed lists should not return pointers.

Ioannis Koutras 13 년 전
부모
커밋
b78d869836
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/linked_lists/search_algorithms.c

+ 2 - 2
src/linked_lists/search_algorithms.c

@@ -38,8 +38,8 @@ void * search_on_fixed(heap_t * heap, size_t requested_size) {
         heap->dmm_stats.total_hops++;
 #endif /* COUNT_HOPS */
         if(node->size == requested_size) {
-            ptr = node->fixed_list_head;
-            if(ptr != NULL) {
+            if(node->fixed_list_head != NULL) {
+                ptr = node->fixed_list_head;
                 node->fixed_list_head = get_next(ptr);
 #ifdef BLOCKS_IN_DLL
                 set_previous(node->fixed_list_head, NULL);