From 6eb9812220fbeb96e31b751b78728c6af358e541 Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Thu, 26 Feb 2004 13:48:16 +0000 Subject: [PATCH] - Fix a duplicated free() in mkntfs. (Andras Erdei) - Fix option display in mkntfs. (Andras Erdei) (Logical change 1.285) --- ChangeLog | 2 ++ ntfsprogs/mkntfs.c | 22 +++++++--------------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 74184e97..a3e178b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,8 @@ xx/xx/2004 - 1.8.5 - WIP instead. This only makes sense with "make libs" and when an application linking statically against libntfs provides its own device io operations. (Feature requested by Christophe Grenier.) + - Fix a duplicated free() in mkntfs. (Andras Erdei) + - Fix option display in mkntfs. (Andras Erdei) 23/01/2004 - 1.8.4 - Memory leak fixes. - Fix memory leaks in libntfs/dir.c::ntfs_inode_lookup_by_name(), diff --git a/ntfsprogs/mkntfs.c b/ntfsprogs/mkntfs.c index 7205821b..76b42ac6 100644 --- a/ntfsprogs/mkntfs.c +++ b/ntfsprogs/mkntfs.c @@ -408,8 +408,6 @@ void append_to_bad_blocks(unsigned long block) if (!new_buf) err_exit("Reallocating memory for bad blocks list " "failed: %s\n", strerror(errno)); - if (opts.bad_blocks != new_buf) - free(opts.bad_blocks); opts.bad_blocks = new_buf; } opts.bad_blocks[opts.nr_bad_blocks++] = block; @@ -656,50 +654,44 @@ void dump_resident_attr_val(ATTR_TYPES type, char *val, u32 val_len) } j = 0; if (i & VOLUME_MODIFIED_BY_CHKDSK) { - j = 1; printf("VOLUME_MODIFIED_BY_CHKDSK"); + j = 1; } if (i & VOLUME_REPAIR_OBJECT_ID) { if (j) printf(" | "); - else - j = 0; printf("VOLUME_REPAIR_OBJECT_ID"); + j = 1; } if (i & VOLUME_DELETE_USN_UNDERWAY) { if (j) printf(" | "); - else - j = 0; printf("VOLUME_DELETE_USN_UNDERWAY"); + j = 1; } if (i & VOLUME_MOUNTED_ON_NT4) { if (j) printf(" | "); - else - j = 0; printf("VOLUME_MOUNTED_ON_NT4"); + j = 1; } if (i & VOLUME_UPGRADE_ON_MOUNT) { if (j) printf(" | "); - else - j = 0; printf("VOLUME_UPGRADE_ON_MOUNT"); + j = 1; } if (i & VOLUME_RESIZE_LOG_FILE) { if (j) printf(" | "); - else - j = 0; printf("VOLUME_RESIZE_LOG_FILE"); + j = 1; } if (i & VOLUME_IS_DIRTY) { if (j) printf(" | "); - else - j = 0; printf("VOLUME_IS_DIRTY"); + j = 1; } printf("\n"); return;