qom: Avoid leaking str and bool properties on failure
When object_property_add_str() and object_property_add_bool() fail, they leak their internal StringProperty and BoolProperty structs. Remember to free the structs on error. Luckily this is a low-impact memory leak since most QOM properties are static qdev properties that will never take the error case. object_property_add() only fails if the property name is already in use. Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> Cc: qemu-stable@nongnu.org Signed-off-by: NAndreas Färber <afaerber@suse.de>
Showing
想要评论请 注册 或 登录