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