From: John Ferlan Date: Thu, 7 Feb 2019 13:07:50 +0000 (-0500) Subject: util: Use VIR_STEAL_PTR in virstoragefile X-Git-Tag: v5.1.0-rc1~125 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d693534fa1a7b946d284cbc2eb4e2b34db0aabf;p=thirdparty%2Flibvirt.git util: Use VIR_STEAL_PTR in virstoragefile 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 --- 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: