[PATCH v2 17/32] util: Use VIR_STEAL_PTR in virstoragefile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



virStorageFileGetRelativeBackingPath and virStorageFileGetMetadataRecurse
open coded.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
Reviewed-by: Erik Skultety <eskultet@xxxxxxxxxx>
---
 src/util/virstoragefile.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 828e95d5d3..c6425308fb 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -4208,8 +4208,7 @@ virStorageFileGetRelativeBackingPath(virStorageSourcePtr top,
         goto cleanup;
     }
 
-    *relpath = path;
-    path = NULL;
+    VIR_STEAL_PTR(*relpath, path);
 
     ret = 0;
 
@@ -4947,8 +4946,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
             goto cleanup;
     }
 
-    src->backingStore = backingStore;
-    backingStore = NULL;
+    VIR_STEAL_PTR(src->backingStore, backingStore);
     ret = 0;
 
  cleanup:
-- 
2.20.1


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux