[libvirt] [PATCH v2 05/32] storage: Use VIR_STEAL_PTR for gluster volume processing
John Ferlan
jferlan at redhat.com
Fri Feb 8 18:36:59 UTC 2019
Signed-off-by: John Ferlan <jferlan at redhat.com>
Reviewed-by: Erik Skultety <eskultet at redhat.com>
---
src/storage/storage_backend_gluster.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_backend_gluster.c
index 559189fd1d..6759d7f1e5 100644
--- a/src/storage/storage_backend_gluster.c
+++ b/src/storage/storage_backend_gluster.c
@@ -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);
--
2.20.1
More information about the libvir-list
mailing list