Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
45e338f
)
libext2fs: don't leak strdup'd dev name in dosio.c upon error
author
Jim Meyering
<jim@meyering.net>
Mon, 23 Feb 2009 16:47:30 +0000
(17:47 +0100)
committer
Theodore Ts'o
<tytso@mit.edu>
Mon, 9 Mar 2009 00:38:20 +0000
(20:38 -0400)
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/dosio.c
patch
|
blob
|
history
diff --git
a/lib/ext2fs/dosio.c
b/lib/ext2fs/dosio.c
index
97ceef5
..
a7968cd
100644
(file)
--- 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;
}