Regards,
-Gonglei


> -----Original Message-----
> From: Paolo Bonzini [mailto:pbonz...@redhat.com]
> Sent: Thursday, March 03, 2016 8:12 PM
> To: Gonglei (Arei); qemu-devel@nongnu.org
> Cc: qemu-triv...@nongnu.org
> Subject: Re: [PATCH 2/6] sheepdog: fix possible resouce leak and out-of-bounds
> access
> 
> 
> 
> 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.
> 
You are right, we'd better drop local_err in sd_snapshot_delete().

Regards,
-Gonglei

Reply via email to