qemu: block: Use VIR_AUTOPTR for virURIPtr

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2019-04-04 11:03:24 +02:00
parent 46bd9ee7d7
commit bc6eabbec3

View File

@ -435,7 +435,7 @@ qemuBlockStorageSourceSupportsConcurrentAccess(virStorageSourcePtr src)
virURIPtr
qemuBlockStorageSourceGetURI(virStorageSourcePtr src)
{
virURIPtr uri = NULL;
VIR_AUTOPTR(virURI) uri = NULL;
virURIPtr ret = NULL;
if (src->nhosts != 1) {
@ -480,7 +480,6 @@ qemuBlockStorageSourceGetURI(virStorageSourcePtr src)
VIR_STEAL_PTR(ret, uri);
cleanup:
virURIFree(uri);
return ret;
}
@ -745,7 +744,7 @@ qemuBlockStorageSourceGetCURLProps(virStorageSourcePtr src)
const char *passwordalias = NULL;
const char *username = NULL;
virJSONValuePtr ret = NULL;
virURIPtr uri = NULL;
VIR_AUTOPTR(virURI) uri = NULL;
char *uristr = NULL;
const char *driver;
@ -782,7 +781,6 @@ qemuBlockStorageSourceGetCURLProps(virStorageSourcePtr src)
NULL));
cleanup:
virURIFree(uri);
VIR_FREE(uristr);
return ret;