Browse Source

Tests: Correctly lock custom memory manager

Stefan Profanter 5 years ago
parent
commit
1f932c6eaf
1 changed files with 1 additions and 1 deletions
  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;