提交 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, ...@@ -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, ...@@ -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, ...@@ -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;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册