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

Re: [libvirt] [PATCH 2/3] conf: Add several cleanup paths



This patch breaks the error return value for:
virDomainControllerDefFormat()
virDomainSoundDefFormat()
virDomainMemballoonDefFormat()

Patch adds the "ret" variable but in error exit it use "return 0" statement.
Actually this breaks compilation. 
Was this code compiled ?

conf/domain_conf.c: In function 'virDomainControllerDefFormat':
conf/domain_conf.c:24368:9: error: variable 'ret' set but not used [-Werror=unused-but-set-variable]
     int ret = -1;
         ^~~
  CC       test/libvirt_driver_test_la-test_driver.lo
  CC       vmx/libvirt_vmx_la-vmx.lo
  CC       vmware/libvirt_driver_vmware_la-vmware_driver.lo
  CC       vmware/libvirt_driver_vmware_la-vmware_conf.lo
conf/domain_conf.c: In function 'virDomainSoundDefFormat':
conf/domain_conf.c:25882:9: error: variable 'ret' set but not used [-Werror=unused-but-set-variable]
     int ret = -1;
         ^~~
conf/domain_conf.c: In function 'virDomainMemballoonDefFormat':
conf/domain_conf.c:25926:9: error: variable 'ret' set but not used [-Werror=unused-but-set-variable]
     int ret = -1;
         ^~~


On Fri, 16 Nov 2018 at 19:56, Pavel Hrdina <phrdina redhat com> wrote:
On Fri, Nov 16, 2018 at 05:21:30PM +0100, Andrea Bolognani wrote:
> In many cases, an early exit from a function would cause
> memory allocated by local virBuffer instances not to be
> released.
>
> Provide proper cleanup paths to solve the issue.
>
> Signed-off-by: Andrea Bolognani <abologna redhat com>
> ---
>  src/conf/domain_conf.c | 137 ++++++++++++++++++++++++++++++-----------
>  1 file changed, 100 insertions(+), 37 deletions(-)

Reviewed-by: Pavel Hrdina <phrdina redhat com>
--
libvir-list mailing list
libvir-list redhat com
https://www.redhat.com/mailman/listinfo/libvir-list

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