mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06:00
error: define g_autoptr() cleanup function for the Error type
Automatic memory management helps avoid memory safety issues. Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com> Link: https://lore.kernel.org/qemu-devel/a5843c5fa64d7e5239a4316092ec0ef0d10c2320.1741124640.git.maciej.szmigiero@oracle.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
parent
6a76eb4872
commit
18eb55546a
1 changed files with 2 additions and 0 deletions
|
@ -437,6 +437,8 @@ Error *error_copy(const Error *err);
|
|||
*/
|
||||
void error_free(Error *err);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(Error, error_free)
|
||||
|
||||
/*
|
||||
* Convenience function to assert that *@errp is set, then silently free it.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue