From: Daan De Meyer <daan.j.demeyer@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
qemu-arm@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Daan De Meyer" <daan.j.demeyer@gmail.com>
Subject: [PATCH v2 2/3] Use g_autofree in unpack_efi_zboot_image()
Date: Sat, 11 Oct 2025 10:13:46 +0200 [thread overview]
Message-ID: <20251011081347.4063198-3-daan.j.demeyer@gmail.com> (raw)
In-Reply-To: <20251011081347.4063198-1-daan.j.demeyer@gmail.com>
Signed-off-by: Daan De Meyer <daan.j.demeyer@gmail.com>
---
hw/core/loader.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 42edcf2d98..e8be700afb 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -864,7 +864,7 @@ struct linux_efi_zboot_header {
ssize_t unpack_efi_zboot_image(uint8_t **buffer, ssize_t *size)
{
const struct linux_efi_zboot_header *header;
- uint8_t *data = NULL;
+ g_autofree uint8_t *data = NULL;
ssize_t ploff, plsize;
ssize_t bytes;
@@ -907,7 +907,7 @@ ssize_t unpack_efi_zboot_image(uint8_t **buffer, ssize_t *size)
}
g_free(*buffer);
- *buffer = g_realloc(data, bytes);
+ *buffer = g_realloc(g_steal_pointer(&data), bytes);
*size = bytes;
return bytes;
}
--
2.51.0
next prev parent reply other threads:[~2025-10-11 8:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-11 8:13 [PATCH v2 0/3] Add support for zboot images compressed with zstd Daan De Meyer
2025-10-11 8:13 ` [PATCH v2 1/3] Rename LOAD_IMAGE_MAX_GUNZIP_BYTES to LOAD_IMAGE_MAX_DECOMPRESSED_BYTES Daan De Meyer
2025-10-11 8:13 ` Daan De Meyer [this message]
2025-10-11 8:13 ` [PATCH v2 3/3] Add support for zboot images compressed with zstd Daan De Meyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251011081347.4063198-3-daan.j.demeyer@gmail.com \
--to=daan.j.demeyer@gmail.com \
--cc=kraxel@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).