提交 95cd4904 编写于 作者: M Michal Privoznik

virDomainSnapshotDefParse: Prefer VIR_STEAL_PTR

Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 f92d164c
......@@ -331,8 +331,7 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt,
"disk-only snapshot"));
goto cleanup;
}
def->file = memoryFile;
memoryFile = NULL;
VIR_STEAL_PTR(def->file, memoryFile);
/* verify that memory path is absolute */
if (def->file && def->file[0] != '/') {
......@@ -372,7 +371,7 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt,
if (!offline && virSaveCookieParse(ctxt, &def->cookie, saveCookie) < 0)
goto cleanup;
ret = def;
VIR_STEAL_PTR(ret, def);
cleanup:
VIR_FREE(creation);
......@@ -380,7 +379,6 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt,
VIR_FREE(nodes);
VIR_FREE(memorySnapshot);
VIR_FREE(memoryFile);
if (ret == NULL)
virDomainSnapshotDefFree(def);
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册