[PATCH] conf: Don't free the constructed string in virDomainGetBlkioParametersAssignFromDef

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

 



virTypedParameterAssign steals the string rather than copying it into
the typed parameter and thus freeing it leads to a crash when attempting
to serialize the results.

This was introduced in commit 9f50f6e2 and later made an universal
helper in 32e6339c.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1351473
---
 src/conf/domain_conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index ef266af..5e2a467 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -24944,7 +24944,7 @@ virDomainGetBlkioParametersAssignFromDef(virDomainDefPtr def,
         if (virTypedParameterAssign(&(params[(*nparams)++]), name,             \
                                     VIR_TYPED_PARAM_STRING, data) < 0)         \
             goto error;                                                        \
-        VIR_FREE(data);                                                        \
+        data = NULL;                                                           \
     }

     /* blkiotune.device_weight */
-- 
2.9.0

--
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]
  Powered by Linux