소스 검색

Tests: Correctly lock custom memory manager

Stefan Profanter 5 년 전
부모
커밋
1f932c6eaf
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      tests/fuzz/custom_memory_manager.c

+ 1 - 1
tests/fuzz/custom_memory_manager.c

@@ -69,8 +69,8 @@ static int addToMap(size_t size, void *addr) {
     newEntry->size = size;
     newEntry->address = addr;
     newEntry->next = NULL;
+	pthread_mutex_lock(&mutex);
     newEntry->prev = address_map_last;
-    pthread_mutex_lock(&mutex);
     if (address_map_last)
         address_map_last->next = newEntry;
     address_map_last = newEntry;