>>
>> +    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
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

Reply via email to