[PATCH] storage: gluster: Don't leak private data when storage file init fails

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

 



In a44b7b87bcc6681e2939f65a3552fc96f68bc7b6 I've introduced a function
that initializes a storage file wrapper object on gluster based volumes.

The initialization function leaks the private data pointer in case of
failure. This patch fixes it.

Reported by John Ferlan.
---

Notes:
    Pushed under the trivial rule.

 src/storage/storage_backend_gluster.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_backend_gluster.c
index a9c33c2..202a441 100644
--- a/src/storage/storage_backend_gluster.c
+++ b/src/storage/storage_backend_gluster.c
@@ -570,6 +570,7 @@ virStorageFileBackendGlusterInit(virStorageFilePtr file)
 error:
     VIR_FREE(priv->volname);
     glfs_fini(priv->vol);
+    VIR_FREE(priv);

     return -1;
 }
-- 
1.8.5.3

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