mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +00:00
virDomainSnapshotDefParse: Prefer VIR_STEAL_PTR
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
f92d164c13
commit
95cd4904e1
@ -331,8 +331,7 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt,
|
|||||||
"disk-only snapshot"));
|
"disk-only snapshot"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
def->file = memoryFile;
|
VIR_STEAL_PTR(def->file, memoryFile);
|
||||||
memoryFile = NULL;
|
|
||||||
|
|
||||||
/* verify that memory path is absolute */
|
/* verify that memory path is absolute */
|
||||||
if (def->file && def->file[0] != '/') {
|
if (def->file && def->file[0] != '/') {
|
||||||
@ -372,7 +371,7 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt,
|
|||||||
if (!offline && virSaveCookieParse(ctxt, &def->cookie, saveCookie) < 0)
|
if (!offline && virSaveCookieParse(ctxt, &def->cookie, saveCookie) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = def;
|
VIR_STEAL_PTR(ret, def);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(creation);
|
VIR_FREE(creation);
|
||||||
@ -380,8 +379,7 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt,
|
|||||||
VIR_FREE(nodes);
|
VIR_FREE(nodes);
|
||||||
VIR_FREE(memorySnapshot);
|
VIR_FREE(memorySnapshot);
|
||||||
VIR_FREE(memoryFile);
|
VIR_FREE(memoryFile);
|
||||||
if (ret == NULL)
|
virDomainSnapshotDefFree(def);
|
||||||
virDomainSnapshotDefFree(def);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user