ext2fs: fix memory leak in an error case in inode_open()

Reported-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
bitmap-optimize
Theodore Ts'o 2010-12-21 18:05:07 -05:00
parent 2150278fa2
commit 58caabc37d
1 changed files with 3 additions and 2 deletions

View File

@ -163,9 +163,10 @@ static errcode_t inode_open(const char *name, int flags, io_channel *channel)
return 0;
cleanup:
if (data) {
if (io->name)
ext2fs_free_mem(&io->name);
if (data)
ext2fs_free_mem(&data);
}
if (io)
ext2fs_free_mem(&io);
return retval;