diff mbox

[v5,2/5] audio: fix capture buffer leaks

Message ID 20170503223846.6559-3-marcandre.lureau@redhat.com
State New
Headers show

Commit Message

Marc-André Lureau May 3, 2017, 10:38 p.m. UTC
Spotted by ASAN.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 audio/audio.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Philippe Mathieu-Daudé May 3, 2017, 11:22 p.m. UTC | #1
Gerd already sent this one few days ago ;)

http://lists.nongnu.org/archive/html/qemu-devel/2017-04/msg05587.html

On 05/03/2017 07:38 PM, Marc-André Lureau wrote:
> Spotted by ASAN.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  audio/audio.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/audio/audio.c b/audio/audio.c
> index c8898d8422..beafed209b 100644
> --- a/audio/audio.c
> +++ b/audio/audio.c
> @@ -2028,6 +2028,8 @@ void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque)
>                      sw = sw1;
>                  }
>                  QLIST_REMOVE (cap, entries);
> +                g_free (cap->hw.mix_buf);
> +                g_free (cap->buf);
>                  g_free (cap);
>              }
>              return;
>
diff mbox

Patch

diff --git a/audio/audio.c b/audio/audio.c
index c8898d8422..beafed209b 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -2028,6 +2028,8 @@  void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque)
                     sw = sw1;
                 }
                 QLIST_REMOVE (cap, entries);
+                g_free (cap->hw.mix_buf);
+                g_free (cap->buf);
                 g_free (cap);
             }
             return;