From 5d693534fa1a7b946d284cbc2eb4e2b34db0aabf Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Thu, 7 Feb 2019 08:07:50 -0500 Subject: [PATCH] util: Use VIR_STEAL_PTR in virstoragefile MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Rather than open coding virStorageFileGetRelativeBackingPath and virStorageFileGetMetadataRecurse, let's make use of the VIR_STEAL_PTR macro. Signed-off-by: John Ferlan Reviewed-by: Erik Skultety Reviewed-by: Ján Tomko --- 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.47.2