Commit a4264b3f authored by Jesper Juhl's avatar Jesper Juhl Committed by Jan Kara

UDF: Close small mem leak in udf_find_entry()

Hi,

There's a small memory leak in fs/udf/namei.c::udf_find_entry().

We dynamically allocate memory for 'fname' with kmalloc() and in most
situations we free it before we leave the function, but there is one
situation where we do not (but should). This patch closes the leak by
jumping to the 'out_ok' label which does the correct cleanup rather than
doing half the cleanup and returning directly.
Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 4651c590
...@@ -227,10 +227,8 @@ static struct fileIdentDesc *udf_find_entry(struct inode *dir, ...@@ -227,10 +227,8 @@ static struct fileIdentDesc *udf_find_entry(struct inode *dir,
} }
if ((cfi->fileCharacteristics & FID_FILE_CHAR_PARENT) && if ((cfi->fileCharacteristics & FID_FILE_CHAR_PARENT) &&
isdotdot) { isdotdot)
brelse(epos.bh); goto out_ok;
return fi;
}
if (!lfi) if (!lfi)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment