diff options
author | Jim Meyering <jim@meyering.net> | 2009-02-23 17:47:30 +0100 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-03-08 20:38:20 -0400 |
commit | 4e711be8d04cb6da9e3e3628f82ee66bfbda23f2 (patch) | |
tree | a53379493b6a9e4865cddd869f5e2ae7ddaa56ff /lib/ext2fs/dosio.c | |
parent | 45e338f5332a54295893dba2e32cc093d1316f60 (diff) | |
download | e2fsprogs-4e711be8d04cb6da9e3e3628f82ee66bfbda23f2.tar.gz |
libext2fs: don't leak strdup'd dev name in dosio.c upon error
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'lib/ext2fs/dosio.c')
-rw-r--r-- | lib/ext2fs/dosio.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/ext2fs/dosio.c b/lib/ext2fs/dosio.c index 97ceef54..a7968cd0 100644 --- a/lib/ext2fs/dosio.c +++ b/lib/ext2fs/dosio.c @@ -278,6 +278,7 @@ static errcode_t dos_open(const char *dev, int flags, io_channel *channel) if(!HW_OK()) { _dio_error = ERR_HARDWARE; + free(part->dev); free(part); return EFAULT; } @@ -297,6 +298,7 @@ static errcode_t dos_open(const char *dev, int flags, io_channel *channel) if(!HW_OK()) { _dio_error = ERR_HARDWARE; + free(part->dev); free(part); return EFAULT; } @@ -308,6 +310,7 @@ static errcode_t dos_open(const char *dev, int flags, io_channel *channel) { _dio_error = part->pno == 0xFE ? ERR_EMPTYPART : part->pno == 0xFD ? ERR_LINUXSWAP : ERR_NOTEXT2FS; + free(part->dev); free(part); return ENODEV; } |