Re: [Qemu-devel] [PATCH v2] rbd: fix leak in qemu_rbd_open failure paths

2011-09-04 Thread Sage Weil
On Sun, 4 Sep 2011, Stefan Hajnoczi wrote: > On Sat, Sep 3, 2011 at 11:04 PM, Sage Weil wrote: > > +failed_shutdown: > >     rados_shutdown(s->cluster); > > +    qemu_free(s->snap); > > Sorry for being a pain here. This patch is against an old qemu.git > tree. All memory allocation is now using

Re: [Qemu-devel] [PATCH v2] rbd: fix leak in qemu_rbd_open failure paths

2011-09-04 Thread Stefan Hajnoczi
On Sat, Sep 3, 2011 at 11:04 PM, Sage Weil wrote: > +failed_shutdown: >     rados_shutdown(s->cluster); > +    qemu_free(s->snap); Sorry for being a pain here. This patch is against an old qemu.git tree. All memory allocation is now using glib's g_malloc()/g_free(). Stefan

[Qemu-devel] [PATCH v2] rbd: fix leak in qemu_rbd_open failure paths

2011-09-03 Thread Sage Weil
Fix leak of s->snap in failure path. Simplify error paths for the whole function. Reported-by: Stefan Hajnoczi Signed-off-by: Sage Weil --- v2: fixes all error paths, not just the first one. block/rbd.c | 28 +--- 1 files changed, 13 insertions(+), 15 deletions(-)