diff --git a/src/c++/vdo/base/logical-zone.c b/src/c++/vdo/base/logical-zone.c index 026f031ff..134778b09 100644 --- a/src/c++/vdo/base/logical-zone.c +++ b/src/c++/vdo/base/logical-zone.c @@ -133,11 +133,11 @@ void vdo_free_logical_zones(struct logical_zones *zones) return; vdo_free(vdo_forget(zones->manager)); + + vdo_free(zones); for (index = 0; index < zones->zone_count; index++) vdo_int_map_free(vdo_forget(zones->zones[index].lbn_operations)); - - vdo_free(zones); } static inline void assert_on_zone_thread(struct logical_zone *zone, const char *what) diff --git a/src/c++/vdo/tests/BlockMapRecovery_t1.c b/src/c++/vdo/tests/BlockMapRecovery_t1.c index 706ab5d92..0870c6430 100644 --- a/src/c++/vdo/tests/BlockMapRecovery_t1.c +++ b/src/c++/vdo/tests/BlockMapRecovery_t1.c @@ -30,7 +30,6 @@ enum { }; static size_t entryCount = 0; -static struct repair_completion *repair_completion = NULL; /** * Initialize the index, vdo, and test data. @@ -75,7 +74,7 @@ static bool preventReferenceCountRebuild(struct vdo_completion *completion) struct vdo_completion *parent = completion->parent; int result = completion->result; - repair_completion = (struct repair_completion *) completion; + free_repair_completion((struct repair_completion *) completion); vdo_fail_completion(parent, result); return false; } @@ -156,7 +155,6 @@ static void testRecovery(size_t desiredEntryCount) // Do a block map recovery. setCompletionEnqueueHook(hijackJournalLoad); performSuccessfulAction(vdo_repair); - free_repair_completion(repair_completion); // Verify that all block map mappings are either the original value or the // new mapping expected from recovery. diff --git a/src/c++/vdo/user/vdoStats.c b/src/c++/vdo/user/vdoStats.c index a536e3d15..56e961b82 100644 --- a/src/c++/vdo/user/vdoStats.c +++ b/src/c++/vdo/user/vdoStats.c @@ -180,8 +180,8 @@ static void displayDFStyle(const char *path, struct vdo_statistics *stats) // Extract the device name. Use strdup for non const string. char *devicePath = strdup(path); - strcpy(dfName, basename(devicePath)); free(devicePath); + strcpy(dfName, basename(devicePath)); // Display the device statistics if (!headerPrinted) {