[PATCH] Don't call VIR_ALLOC on def->uuid in parallels storage driver

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

The 'uuid' field in virDomainDefPtr is not a pointer, it is a
fixed length array. Calling VIR_ALLOC on it is thus wrong and
leaks memory.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 src/parallels/parallels_storage.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/parallels/parallels_storage.c b/src/parallels/parallels_storage.c
index 3e254ce..44246a7 100644
--- a/src/parallels/parallels_storage.c
+++ b/src/parallels/parallels_storage.c
@@ -173,9 +173,6 @@ parallelsPoolCreateByPath(virConnectPtr conn, const char *path)
     if (!(def->name = parallelsMakePoolName(conn, path)))
         goto error;
 
-    if (VIR_ALLOC_N(def->uuid, VIR_UUID_BUFLEN))
-        goto error;
-
     if (virUUIDGenerate(def->uuid)) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("Can't generate UUID"));
-- 
1.8.3.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]