aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej S. Szmigiero <maciej.szmigiero@oracle.com>2025-03-04 23:03:55 +0100
committerCédric Le Goater <clg@redhat.com>2025-03-06 06:47:34 +0100
commitfda70ed83d54abad6bf2d437a7c05204b0fad228 (patch)
treeec0ae7640de8bf53e9520b5304e1d691833fd7d4
parentc59748c1ff924963a67af9efd7e1a1ee6f82d6d6 (diff)
downloadqemu-fda70ed83d54abad6bf2d437a7c05204b0fad228.zip
qemu-fda70ed83d54abad6bf2d437a7c05204b0fad228.tar.gz
qemu-fda70ed83d54abad6bf2d437a7c05204b0fad228.tar.bz2
migration/qemu-file: Define g_autoptr() cleanup function for QEMUFile
Automatic memory management helps avoid memory safety issues. Reviewed-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com> Link: https://lore.kernel.org/qemu-devel/2fd01d773a783d572dcf538a064a98cc09e75c12.1741124640.git.maciej.szmigiero@oracle.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
-rw-r--r--migration/qemu-file.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/migration/qemu-file.h b/migration/qemu-file.h
index 3e47a20..f5b9f43 100644
--- a/migration/qemu-file.h
+++ b/migration/qemu-file.h
@@ -33,6 +33,8 @@ QEMUFile *qemu_file_new_input(QIOChannel *ioc);
QEMUFile *qemu_file_new_output(QIOChannel *ioc);
int qemu_fclose(QEMUFile *f);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(QEMUFile, qemu_fclose)
+
/*
* qemu_file_transferred:
*