[libvirt] [PATCH v2 05/32] storage: Use VIR_STEAL_PTR for gluster volume processing

John Ferlan posted 32 patches 7 years ago
There is a newer version of this series
[libvirt] [PATCH v2 05/32] storage: Use VIR_STEAL_PTR for gluster volume processing
Posted by John Ferlan 7 years ago
Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 05/32] storage: Use VIR_STEAL_PTR for gluster volume processing
Posted by Ján Tomko 6 years, 12 months ago
On Fri, Feb 08, 2019 at 01:36:59PM -0500, John Ferlan wrote:
>Signed-off-by: John Ferlan <jferlan@redhat.com>
>Reviewed-by: Erik Skultety <eskultet@redhat.com>
>---
> src/storage/storage_backend_gluster.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list