diff --git a/include/ntfs/layout.h b/include/ntfs/layout.h index f8652e06..b2d7446f 100644 --- a/include/ntfs/layout.h +++ b/include/ntfs/layout.h @@ -27,7 +27,8 @@ #include "support.h" /* The NTFS oem_id */ -#define magicNTFS const_cpu_to_le64(0x202020205346544e) /* "NTFS " */ +#define magicNTFS const_cpu_to_le64(0x202020205346544e) /* "NTFS " */ +#define NTFS_SB_MAGIC 0x5346544e /* 'NTFS' */ /* * Location of bootsector on partition: @@ -1003,7 +1004,7 @@ typedef struct { /* * The maximum allowed length for a file name. */ -#define MAXIMUM_FILE_NAME_LENGTH 255 +#define NTFS_MAX_NAME_LEN 255 /* * Possible namespaces for filenames in ntfs (8-bit). diff --git a/libntfs/attrib.c b/libntfs/attrib.c index c22a15de..e59a512e 100644 --- a/libntfs/attrib.c +++ b/libntfs/attrib.c @@ -1212,9 +1212,11 @@ s64 ntfs_attr_pwrite(ntfs_attr *na, const s64 pos, s64 count, void *b) eo = errno; Dprintf("%s(): Failed to zero area.\n", __FUNCTION__); + free(buf); errno = eo; goto err_out; } + free(buf); } if (rl->vcn < cur_vcn) { /*