The libgfapi function glfs_fini doesn't tolerate NULL pointers. Add a
check on the error paths as it's possible to crash libvirtd if the
gluster volume can't be initialized.
file, file->hosts[0].name, file->path);
virStorageFileBackendGlusterPrivPtr priv = file->priv;
- glfs_fini(priv->vol);
+ if (priv->vol)
+ glfs_fini(priv->vol);
VIR_FREE(priv->volname);
VIR_FREE(priv);
error:
VIR_FREE(priv->volname);
- glfs_fini(priv->vol);
+ if (priv->vol)
+ glfs_fini(priv->vol);
VIR_FREE(priv);
return -1;