test-bitmap: Fix multiple minor memory leaks
authorThomas Graf <tgraf@noironetworks.com>
Mon, 1 Sep 2014 16:10:26 +0000 (18:10 +0200)
committerBen Pfaff <blp@nicira.com>
Tue, 2 Sep 2014 15:37:50 +0000 (08:37 -0700)
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
tests/test-bitmap.c

index b1274e3..3644419 100644 (file)
@@ -56,6 +56,9 @@ test_bitmap_equal(void)
     assert(!bitmap_equal(a, b, 11 * BITMAP_ULONG_BITS - 1));
     assert(!bitmap_equal(a, b,
                          11 * BITMAP_ULONG_BITS - (BITMAP_ULONG_BITS - 1)));
+
+    free(b);
+    free(a);
 }
 
 /* Tests bitmap_scan. */
@@ -107,6 +110,8 @@ test_bitmap_scan(void)
     assert(bitmap_scan(a, false, 0, MAX_BITS - 1) == BITMAP_ULONG_BITS - 1);
     bitmap_set0(a, 0);
     assert(bitmap_scan(a, false, 0, MAX_BITS - 1) == 0);
+
+    free(a);
 }
 
 static void