Re: [PATCH][next] smack: fix two memory leaks in smack_add_opt

2018-12-22 Thread Colin Ian King
On 22/12/2018 19:34, Al Viro wrote: > On Sat, Dec 22, 2018 at 12:27:50PM +, Colin King wrote: >> From: Colin Ian King >> >> 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 i

Re: [PATCH][next] smack: fix two memory leaks in smack_add_opt

2018-12-22 Thread Al Viro
On Sat, Dec 22, 2018 at 12:27:50PM +, Colin King wrote: > From: Colin Ian King > > 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 le

[PATCH][next] smack: fix two memory leaks in smack_add_opt

2018-12-22 Thread Colin King
From: Colin Ian King 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.