]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Don't call VIR_ALLOC on def->uuid in parallels storage driver
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 3 Sep 2013 15:23:42 +0000 (16:23 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 4 Sep 2013 13:54:54 +0000 (14:54 +0100)
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@redhat.com>
src/parallels/parallels_storage.c

index 3e254ce8eb43f6a2c8f80e13945b0e4f4b4ac177..44246a7b43a40009e49b535be0260d83b24db984 100644 (file)
@@ -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"));