]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: gluster: Don't leak private data when storage file init fails
authorPeter Krempa <pkrempa@redhat.com>
Fri, 14 Feb 2014 12:08:39 +0000 (13:08 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 14 Feb 2014 12:08:39 +0000 (13:08 +0100)
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.

src/storage/storage_backend_gluster.c

index a9c33c2b48cb22b9d47d827a5e3e570acc706b57..202a441ba88d4a5e1c98bc996aa8064f136605e2 100644 (file)
@@ -570,6 +570,7 @@ virStorageFileBackendGlusterInit(virStorageFilePtr file)
 error:
     VIR_FREE(priv->volname);
     glfs_fini(priv->vol);
+    VIR_FREE(priv);
 
     return -1;
 }