[libvirt] [PATCH v2 25/32] storage: Use VIR_STEAL_PTR in storageBackendProbeTarget

John Ferlan jferlan at redhat.com
Fri Feb 8 18:37:19 UTC 2019


Signed-off-by: John Ferlan <jferlan at redhat.com>
Reviewed-by: Erik Skultety <eskultet at redhat.com>
---
 src/storage/storage_util.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index 012c6b319b..af6ab20ea6 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -3450,13 +3450,11 @@ storageBackendProbeTarget(virStorageSourcePtr target,
     }
 
     virBitmapFree(target->features);
-    target->features = meta->features;
-    meta->features = NULL;
+    VIR_STEAL_PTR(target->features, meta->features);
 
     if (meta->compat) {
         VIR_FREE(target->compat);
-        target->compat = meta->compat;
-        meta->compat = NULL;
+        VIR_STEAL_PTR(target->compat, meta->compat);
     }
 
  cleanup:
-- 
2.20.1




More information about the libvir-list mailing list