lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 23 Feb 2009 17:47:30 +0100
From:	Jim Meyering <jim@...ering.net>
To:	linux-ext4@...r.kernel.org
Subject: [PATCH] * lib/ext2fs/dosio.c (dos_open): don't leak strdup'd dev name upon error


Signed-off-by: Jim Meyering <meyering@...hat.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
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ