From d00b261816872d3e48adca584fca80ca21985f3b Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Fri, 21 Jan 2011 19:53:55 +0900 Subject: [PATCH] monitor: use after free in do_wav_capture() use after free in do_wav_capture() on the error path. Signed-off-by: Isaku Yamahata Signed-off-by: Aurelien Jarno --- monitor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index 0cda3dad2c..c5f54f46c7 100644 --- a/monitor.c +++ b/monitor.c @@ -2509,8 +2509,9 @@ static void do_wav_capture(Monitor *mon, const QDict *qdict) nchannels = has_channels ? nchannels : 2; if (wav_start_capture (s, path, freq, bits, nchannels)) { - monitor_printf(mon, "Faied to add wave capture\n"); + monitor_printf(mon, "Failed to add wave capture\n"); qemu_free (s); + return; } QLIST_INSERT_HEAD (&capture_head, s, entries); }