提交 3829cb46 编写于 作者: J Juan Quintela 提交者: Anthony Liguori

vmdk: share cleanup code

cleanup code is identical for error/success cases.  Only difference
are goto labels.
Signed-off-by: NJuan Quintela <quintela@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 a161329b
......@@ -334,18 +334,13 @@ static int vmdk_snapshot_create(const char *filename, const char *backing_file)
ret = -errno;
goto fail_gd;
}
qemu_free(gd_buf);
qemu_free(rgd_buf);
close(p_fd);
close(snp_fd);
return 0;
ret = 0;
fail_gd:
fail_gd:
qemu_free(gd_buf);
fail_rgd:
fail_rgd:
qemu_free(rgd_buf);
fail:
fail:
close(p_fd);
close(snp_fd);
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册