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

John Ferlan posted 32 patches 6 years, 12 months ago
There is a newer version of this series
[libvirt] [PATCH v2 25/32] storage: Use VIR_STEAL_PTR in storageBackendProbeTarget
Posted by John Ferlan 6 years, 12 months ago
Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 25/32] storage: Use VIR_STEAL_PTR in storageBackendProbeTarget
Posted by Ján Tomko 6 years, 12 months ago
On Fri, Feb 08, 2019 at 01:37:19PM -0500, John Ferlan wrote:
>Signed-off-by: John Ferlan <jferlan@redhat.com>
>Reviewed-by: Erik Skultety <eskultet@redhat.com>
>---
> src/storage/storage_util.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