storage: Use VIR_STEAL_PTR for gluster volume processing

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
John Ferlan 2019-02-07 08:04:20 -05:00
parent cf46075293
commit e687538d3a

View File

@ -278,8 +278,7 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlusterStatePtr state,
if (S_ISDIR(st->st_mode)) {
vol->type = VIR_STORAGE_VOL_NETDIR;
vol->target.format = VIR_STORAGE_FILE_DIR;
*volptr = vol;
vol = NULL;
VIR_STEAL_PTR(*volptr, vol);
ret = 0;
goto cleanup;
}
@ -328,8 +327,7 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlusterStatePtr state,
vol->target.compat = meta->compat;
meta->compat = NULL;
*volptr = vol;
vol = NULL;
VIR_STEAL_PTR(*volptr, vol);
ret = 0;
cleanup:
virStorageSourceFree(meta);