]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/audio/asc: replace g_malloc0() with g_malloc()
authorVolker Rümelin <vr_qemu@t-online.de>
Thu, 15 May 2025 05:44:27 +0000 (07:44 +0200)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Sun, 25 May 2025 09:28:28 +0000 (11:28 +0200)
There is no need to allocate initialized memory with g_malloc0()
if it's directly followed by a memset() function call. g_malloc()
is sufficient.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20250515054429.7385-5-vr_qemu@t-online.de>

hw/audio/asc.c

index 6721c0d9fb0eaab7854d1807a8785ec363f08e76..edd42d6d91c9deb23fdc77fcda17f178f8c70672 100644 (file)
@@ -664,7 +664,7 @@ static void asc_realize(DeviceState *dev, Error **errp)
     s->samples = AUD_get_buffer_size_out(s->voice) >> s->shift;
     s->mixbuf = g_malloc0(s->samples << s->shift);
 
-    s->silentbuf = g_malloc0(s->samples << s->shift);
+    s->silentbuf = g_malloc(s->samples << s->shift);
     memset(s->silentbuf, 0x80, s->samples << s->shift);
 
     /* Add easc registers if required */