lkml.org 
[lkml]   [2018]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH][next] smack: fix two memory leaks in smack_add_opt
From
Date
On 22/12/2018 19:34, Al Viro wrote:
> On Sat, Dec 22, 2018 at 12:27:50PM +0000, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Currently if s is null or when returning via the error exit label
>> out_opt_err leaks of the allocated opts can occur. Fix the leak
>> on the null s case by checking s is null before the allocation. Fix
>> the leak on the exit path by checking if opts was allocated by
>> kfree'ing opts.
>>
>> Detected by CoverityScan, CID#1475953 ("Resource leak")
>>
>> Fixes: b2130173efae ("smack: take the guts of smack_parse_opts_str() into a new helper")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>
> There's a better fix in local tree, will go into -next tonight.
>
OK, sounds good to me. Thanks

Colin

\
 
 \ /
  Last update: 2018-12-23 00:05    [W:0.027 / U:0.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site