Re: [libvirt] [PATCH] virsh.c: avoid leak on OOM error path

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

 



> >> diff --git a/tools/virsh.c b/tools/virsh.c
> >> index dd916f3..c8ae9f2 100644
> >> --- a/tools/virsh.c
> >> +++ b/tools/virsh.c
> >> @@ -7139,6 +7139,8 @@ cleanup:
> >>      return ret;
> >>
> >>  no_memory:
> >> +    VIR_FREE(list);
> >> +    VIR_FREE(buffer);
> >>      vshError(ctl, "%s", _("Out of memory"));
> >>      ret = FALSE;
> >>      return ret;
> >
> > Actually that's not enough and it also duplicates code as all the cleanup code
> > is already there:
> 
> Indeed.
> The only piece of cleanup: code that is not needed
> on the current no_memory path is the freeing of "result".
> Plugging more leaks and avoiding duplication.
> Definite improvement.  ACK.

Thanks, pushed.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]