From: Philippe Mathieu-Daudé Date: Wed, 7 Aug 2024 20:28:02 +0000 (+0200) Subject: hw/ssi/pnv_spi: Match _xfer_buffer_free() with _xfer_buffer_new() X-Git-Tag: v9.2.0-rc0~22^2~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=65f53702d2e4bd045ce16ca874469cdd1e1ef4e4;p=thirdparty%2Fqemu.git hw/ssi/pnv_spi: Match _xfer_buffer_free() with _xfer_buffer_new() pnv_spi_xfer_buffer_new() allocates %payload using g_malloc0(), and pnv_spi_xfer_buffer_write_ptr() allocates %payload->data using g_realloc(). Use the API equivalent g_free() to release the buffers. Cc: qemu-stable@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Nicholas Piggin --- diff --git a/hw/ssi/pnv_spi.c b/hw/ssi/pnv_spi.c index 9e7207bf7c0..d15a5970b41 100644 --- a/hw/ssi/pnv_spi.c +++ b/hw/ssi/pnv_spi.c @@ -53,8 +53,8 @@ static PnvXferBuffer *pnv_spi_xfer_buffer_new(void) static void pnv_spi_xfer_buffer_free(PnvXferBuffer *payload) { - free(payload->data); - free(payload); + g_free(payload->data); + g_free(payload); } static uint8_t *pnv_spi_xfer_buffer_write_ptr(PnvXferBuffer *payload,