On 2020/7/21 19:54, Daniel P. Berrangé wrote: > On Fri, Jul 17, 2020 at 05:19:43PM +0800, Zhenyu Ye wrote: >> We add the reference of creds in migration_tls_get_creds(), >> but there was no place to unref it. So the OBJECT(creds) will >> never be freed and result in memory leak. >> >> Unref the creds after creating the tls-channel server/client. >> ... >> >> + >> +cleanup: >> + object_unref(OBJECT(creds)); >> } > > Simpler to just change migration_tls_get_creds() to remove the > object_ref() call, since we're fine to use the borrowed reference > in these methods. >
Thanks for your review. I have sent a new series since the current title "unref creds after used" is no longer appropriate: https://lore.kernel.org/qemu-devel/[email protected]/ Thanks, Zhenyu
