[PATCH] Fix a memory leak in cmdSchedInfoUpdateOne

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

 



From: hwbi <hwbi2008@xxxxxxxxx>

The param needs to be virTypedParamsFree()'d in cmdSchedInfoUpdateOne().
---
 tools/virsh-domain.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index b29f934..d704053 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -4085,7 +4085,7 @@ cmdSchedInfoUpdateOne(vshControl *ctl,
                       int *nparams, int *maxparams,
                       const char *field, const char *value)
 {
-    virTypedParameterPtr param;
+    virTypedParameterPtr param = NULL;
     int ret = -1;
     size_t i;
 
@@ -4109,6 +4109,7 @@ cmdSchedInfoUpdateOne(vshControl *ctl,
         vshError(ctl, _("invalid scheduler option: %s"), field);
 
  cleanup:
+    virTypedParamsFree(param, *nparams);
     return ret;
 }
 
-- 
1.7.1

--
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]