mkntfs.c:
@@ -402,8 +402,6 @@
if (!new_buf)
err_exit("Reallocating memory for bad blocks list=
"
"failed: %s\n", strerror(errno));
- if (opts.bad_blocks !=3D new_buf)
- free(opts.bad_blocks);
opts.bad_blocks =3D new_buf;
}
opts.bad_blocks[opts.nr_bad_blocks++] =3D block;
the original code free()s up a block on the heap that was
already free()-d by realloc()
mkntfs.c:
@@ -640,50 +640,44 @@
}
j =3D 0;
if (i & VOLUME_MODIFIED_BY_CHKDSK) {
- j =3D 1;
printf("VOLUME_MODIFIED_BY_CHKDSK");
+ j =3D 1;
}
if (i & VOLUME_REPAIR_OBJECT_ID) {
if (j)
printf(" | ");
- else
- j =3D 0;
printf("VOLUME_REPAIR_OBJECT_ID");
+ j =3D 1;
}
if (i & VOLUME_DELETE_USN_UNDERWAY) {
if (j)
printf(" | ");
- else
- j =3D 0;
printf("VOLUME_DELETE_USN_UNDERWAY");
+ j =3D 1;
}
if (i & VOLUME_MOUNTED_ON_NT4) {
if (j)
printf(" | ");
- else
- j =3D 0;
printf("VOLUME_MOUNTED_ON_NT4");
+ j =3D 1;
}
if (i & VOLUME_UPGRADE_ON_MOUNT) {
if (j)
printf(" | ");
- else
- j =3D 0;
printf("VOLUME_UPGRADE_ON_MOUNT");
+ j =3D 1;
}
if (i & VOLUME_RESIZE_LOG_FILE) {
if (j)
printf(" | ");
- else
- j =3D 0;
printf("VOLUME_RESIZE_LOG_FILE");
+ j =3D 1;
}
if (i & VOLUME_IS_DIRTY) {
if (j)
printf(" | ");
- else
- j =3D 0;
printf("VOLUME_IS_DIRTY");
+ j =3D 1;
}
printf("\n");
return;
i assume the intention is to output "|"s between the flags
listed, but the original code will insert it only between
the first two flags
br,
andras
|