Re: [PATCH v3] libmultipath: fix memory leaks in coalesce_paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>
>> +	if (mpvec)
>> +		newmp = mpvec;
>> +	else
>> +		newmp = vector_alloc();
>> +	if (!newmp) {
>> +		condlog(0, "can not allocate newmp");
>> +		return ret;
>> +	}
>> +
> 
> It's possible that this patch is based on different code than I am
> looking at, but otherwise, You should either move this code below the
> code that checks the pathvec size and allocates the bitfield, or make
> the failure path for that code free newmp, if necessary. Otherwise, you
> could leak newmp on those failures.
> 
> -Ben
> 
>>  	/* ignore refwwid if it's empty */
>>  	if (refwwid && !strlen(refwwid))
>>  		refwwid = NULL;
Hi

Thanks for your great advice. I will move these codes after checking
the pathvec size and allocating the bitfield.

Regarts,
Lixiaokeng

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux