qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [PATCH 2/6] sheepdog: fix possible resouce leak and o


From: Gonglei (Arei)
Subject: Re: [Qemu-trivial] [PATCH 2/6] sheepdog: fix possible resouce leak and out-of-bounds access
Date: Thu, 3 Mar 2016 12:35:47 +0000




Regards,
-Gonglei


> -----Original Message-----
> From: Paolo Bonzini [mailto:address@hidden
> Sent: Thursday, March 03, 2016 8:12 PM
> To: Gonglei (Arei); address@hidden
> Cc: address@hidden
> 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

[Prev in Thread] Current Thread [Next in Thread]