On 03/03/2016 13:00, Gonglei (Arei) wrote:
>>> > >
>>> > > - ret = find_vdi_name(s, s->name, snap_id, snap_tag, &vid, true,
>>> > > + ret = find_vdi_name(s, s->name, hdr.snapid, snap_tag, &vid, true,
>>> > > &local_err);
>>> > > if (ret) {
>>> > > + error_report_err(local_err);
>>> > > return ret;
>>> > > }
>>> > >
>>> > >
>> >
>> > A patch for this has been posted yesterday by Jeff Cody.
>> >
> OK, I found it. And Max's comments is right, Jef can use hdr.snapid instead
> of snap_tag
> to invoke find_vdi_name().
>
> But, except that fix, My patch also fixed a memory leak, did you see that?
No, I didn't notice -- it's not clear that error_report_err also frees
the error.
> Do I need post an separate patch to fix memory leak?
Yes, but the right fix in my opinion is to pass errp to find_vdi_name
instead.
Paolo