monitor: use after free in do_wav_capture()

use after free in do_wav_capture() on the error path.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
Isaku Yamahata 2011-01-21 19:53:55 +09:00 committed by Aurelien Jarno
parent 52108a1ff0
commit d00b261816

View File

@ -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);
}