[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/6] sheepdog: fix possible resouce leak and out
From: |
Gonglei (Arei) |
Subject: |
Re: [Qemu-devel] [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
[Qemu-devel] [PATCH 4/6] hostmem-file: fix memory leak, Gonglei, 2016/03/03
[Qemu-devel] [PATCH 3/6] spice: fix coverity complains, Gonglei, 2016/03/03
[Qemu-devel] [PATCH 5/6] spapr: fix possible Negative array index read, Gonglei, 2016/03/03
[Qemu-devel] [PATCH 6/6] smbus: fix memory leak, Gonglei, 2016/03/03
[Qemu-devel] [PATCH 1/6] egl-helpers: fix possible resource leak, Gonglei, 2016/03/03