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 <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
John Ferlan 2019-02-07 08:07:50 -05:00
parent a1c453dc08
commit 5d693534fa

View File

@ -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: