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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1291020917-8671-9-git-send-email-namhyung@gmail.com>
Date:	Mon, 29 Nov 2010 17:55:10 +0900
From:	Namhyung Kim <namhyung@...il.com>
To:	Theodore Tso <tytso@....edu>
Cc:	linux-ext4@...r.kernel.org
Subject: [PATCH 08/15] libext2fs: fix memory leak on error path

io->name should be freed if ext2fs_file_open2() fails.

Signed-off-by: Namhyung Kim <namhyung@...il.com>
---
 lib/ext2fs/inode_io.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/ext2fs/inode_io.c b/lib/ext2fs/inode_io.c
index 4faaa48..bc934d3 100644
--- a/lib/ext2fs/inode_io.c
+++ b/lib/ext2fs/inode_io.c
@@ -157,11 +157,13 @@ static errcode_t inode_open(const char *name, int flags, io_channel *channel)
 				   &data->inode : 0, open_flags,
 				   &data->file);
 	if (retval)
-		goto cleanup;
+		goto cleanup_name;
 
 	*channel = io;
 	return 0;
 
+cleanup_name:
+	ext2fs_free_mem(&io->name);
 cleanup:
 	if (data) {
 		ext2fs_free_mem(&data);
-- 
1.7.0.4

--
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