Prechádzať zdrojové kódy

Tests: Correctly lock custom memory manager

Stefan Profanter 5 rokov pred
rodič
commit
1f932c6eaf
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  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;