> Should we directly call curl_close() here instead? Otherwise
> factor a common curl_cleanup() out and reuse?
Thanks for the suggestion.
I don't think curl_close() can be used directly from out_noclean, since
out_noclean is reached from partially initialized states.
curl_close() assumes a successfully opened instance and tears down the
aio/curl state via curl_detach_aio_context(), while out_noclean is used
before curl_attach_aio_context() and, in some cases, before s->sockets is
initialized.
So I think reusing curl_close() here would conflate the open-failure and
normal close paths.
If we want to deduplicate this later, factoring out only the common field
cleanup into a small helper should be safer.
Thanks,
GuoHan
日 期:2026年03月20日17:24
发件人:Philippe Mathieu-Daudé
收件人:zhaoguohan_salmon,Kevin Wolf,Hanna Reitz,Philippe Mathieu-Daudé
抄送人:qemu-block,qemu-devel
---
