From b1dfa2b306c704d88c2586ff7a13cdebc0820426 Mon Sep 17 00:00:00 2001 From: cha0smaster Date: Sun, 12 Jun 2005 15:23:25 +0000 Subject: [PATCH] - Fix memleak in ntfs_attr_pwrite - Update layout.h a bit to be a kernel driver like. --- include/ntfs/layout.h | 5 +++-- libntfs/attrib.c | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) 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) { /*