linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] * lib/ext2fs/dosio.c (dos_open): don't leak strdup'd dev name upon error
@ 2009-02-23 16:47 Jim Meyering
  2009-03-09  0:40 ` Theodore Tso
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Meyering @ 2009-02-23 16:47 UTC (permalink / raw)
  To: linux-ext4


Signed-off-by: Jim Meyering <meyering@redhat.com>
---
Spotted by inspection.
For all I know, this is dead code ;-)

 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 97ceef5..a7968cd 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;
   }
--
1.6.2.rc1.266.g4bdf

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] * lib/ext2fs/dosio.c (dos_open): don't leak strdup'd dev name upon error
  2009-02-23 16:47 [PATCH] * lib/ext2fs/dosio.c (dos_open): don't leak strdup'd dev name upon error Jim Meyering
@ 2009-03-09  0:40 ` Theodore Tso
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Tso @ 2009-03-09  0:40 UTC (permalink / raw)
  To: Jim Meyering; +Cc: linux-ext4

Thanks, applied.

					- Ted


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-09  3:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-23 16:47 [PATCH] * lib/ext2fs/dosio.c (dos_open): don't leak strdup'd dev name upon error Jim Meyering
2009-03-09  0:40 ` Theodore Tso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).