lkml.org 
[lkml]   [2020]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] exfat: fix memory leak in exfat_parse_param()
On Wed, Jun 03, 2020 at 10:29:57AM +0900, Namjae Jeon wrote:

> exfat_free() should call exfat_free_iocharset() after stealing
> param->string instead of kstrdup in exfat_parse_param().

ITYM
extfat_free() should call exfat_free_iocharset(), to prevent
a leak in case we fail after parsing iocharset= but before calling
get_tree_bdev()

Additionally, there's no point copying param->string in
exfat_parse_param() - just steal it, leaving NULL in param->string.
That's independent from the leak or fix thereof - it's simply
avoiding an extra copy.

\
 
 \ /
  Last update: 2020-06-03 03:58    [W:0.054 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site