Browse Source

Free all the allocators

Caleb James DeLisle 5 years ago
parent
commit
051421af33

+ 1 - 0
crypto/test/ReplayProtector_test.c

@@ -52,5 +52,6 @@ int main()
     for (int i = 0; i < CYCLES; i++) {
         testDuplicates(rand);
     }
+    Allocator_free(alloc);
     return 0;
 }

+ 2 - 0
crypto/test/Sign_test.c

@@ -42,5 +42,7 @@ int main()
     Assert_true(!Sign_verifyMsg(&signingKeyPair[32], msg));
     Assert_true(!Sign_publicSigningKeyToCurve25519(curve25519publicB, &signingKeyPair[32]));
     Assert_true(!Bits_memcmp(curve25519publicB, curve25519public, 32));
+
+    Allocator_free(alloc);
     return 0;
 }

+ 1 - 0
interface/tuntap/test/BSDMessageTypeWrapper_test.c

@@ -61,5 +61,6 @@ int main()
     Iface_send(&ctx->inside, msg);
 
     Assert_true(ctx->received == 3);
+    Allocator_free(alloc);
     return 0;
 }

+ 2 - 0
switch/test/EncodingScheme_test.c

@@ -422,5 +422,7 @@ int main()
     }
     Allocator_free(tempAlloc);
 
+    Allocator_free(alloc);
+
     return 0;
 }

+ 1 - 1
test/printIp_test.c

@@ -55,6 +55,6 @@ int main()
         Assert_true(0 == Bits_memcmp(ip, ipFromFull, 16));
         Assert_true(0 == Bits_memcmp(ipFromFull, ipFromShort, 16));
     }
-
+    Allocator_free(alloc);
     return 0;
 }

+ 1 - 9
tunnel/test/IpTunnel_test.c

@@ -388,14 +388,6 @@ int main()
     testAddr(ctx, "192.168.1.1", 16, 24, "fd00::1", 8, 64);
     testAddr(ctx, "192.168.1.1", 16, 24, "fd00::1", 64, 128);
 
-    //Allocator_free(alloc); //TODO(cjd): This is caused by an allocator bug.
-    /* To repeat the bug, create a test like this:
-    struct Allocator* allocx = Allocator_child(alloc);
-    Timeout_setInterval(NULL, NULL, 10000, eb, allocx);
-    Allocator_snapshot(alloc, true);
-    Allocator_free(allocx);
-    Allocator_snapshot(alloc, true);
-    return 0;
-    */
+    Allocator_free(alloc);
     return 0;
 }

+ 2 - 0
util/test/AverageRoller_test.c

@@ -68,5 +68,7 @@ int main()
             ret = 1;
         }
     }
+
+    Allocator_free(allocator);
     return ret;
 }