]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage: Use VIR_STEAL_PTR for gluster volume processing
authorJohn Ferlan <jferlan@redhat.com>
Thu, 7 Feb 2019 13:04:20 +0000 (08:04 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 12 Feb 2019 13:51:23 +0000 (08:51 -0500)
Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/storage/storage_backend_gluster.c

index 559189fd1de8144865f68a7dba63a5137e156b49..6759d7f1e564720b7bc3b83ac855d103de4291d3 100644 (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);