Marc-André Lureau 6d6e23361f hw/audio/hda: fix memory leak on audio setup
When SET_STREAM_FORMAT is called, we should clear the existing setup.

Factor out common function to close a stream.

Direct leak of 144 byte(s) in 3 object(s) allocated from:
    #0 0x7f91d38f7350 in calloc (/lib64/libasan.so.8+0xf7350) (BuildId: a4ad7eb954b390cf00f07fa10952988a41d9fc7a)
    #1 0x7f91d2ab7871 in g_malloc0 (/lib64/libglib-2.0.so.0+0x64871) (BuildId: 36b60dbd02e796145a982d0151ce37202ec05649)
    #2 0x562fa2f447ee in timer_new_full /home/elmarco/src/qemu/include/qemu/timer.h:538
    #3 0x562fa2f4486f in timer_new /home/elmarco/src/qemu/include/qemu/timer.h:559
    #4 0x562fa2f448a9 in timer_new_ns /home/elmarco/src/qemu/include/qemu/timer.h:577
    #5 0x562fa2f47955 in hda_audio_setup ../hw/audio/hda-codec.c:490
    #6 0x562fa2f4897e in hda_audio_command ../hw/audio/hda-codec.c:605

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-ID: <20241008125028.1177932-3-marcandre.lureau@redhat.com>
2024-10-14 17:34:09 +04:00
..
2024-05-03 15:47:47 +02:00
2024-10-11 12:32:17 +02:00
2024-05-03 15:47:47 +02:00
2024-10-01 14:58:07 +01:00
2024-10-01 14:44:42 +01:00
2024-10-03 19:33:23 +02:00
2024-10-01 14:41:10 +01:00
2024-10-02 16:30:06 +01:00
2023-12-29 11:17:30 +11:00
2023-12-29 11:17:30 +11:00
2024-10-03 19:33:23 +02:00
2024-10-03 19:33:23 +02:00
2024-10-01 09:02:05 +02:00
2024-10-03 17:26:06 +03:00
2024-10-03 19:33:23 +02:00
2024-10-03 17:26:05 +03:00
2024-10-03 19:33:23 +02:00
2024-10-01 14:40:59 +01:00
2024-10-03 19:33:23 +02:00
2024-10-01 14:57:13 +01:00
2024-10-01 14:56:27 +01:00
2024-10-03 19:33:23 +02:00