From adccd96c2bb38e14afcb6569748027ab26da3a7b Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Mon, 12 Jun 2023 00:03:09 -0600 Subject: [PATCH] windows.media.speech: Fix memory leak on error path in session_worker_thread_cb (scan-build). --- dlls/windows.media.speech/recognizer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/windows.media.speech/recognizer.c b/dlls/windows.media.speech/recognizer.c index c2f386206b8..790d127fc64 100644 --- a/dlls/windows.media.speech/recognizer.c +++ b/dlls/windows.media.speech/recognizer.c @@ -193,7 +193,7 @@ static DWORD CALLBACK session_worker_thread_cb( void *args ) struct session *impl = impl_from_ISpeechContinuousRecognitionSession(iface); BOOLEAN running = TRUE, paused = FALSE; UINT32 frame_count, tmp_buf_size; - BYTE *audio_buf, *tmp_buf; + BYTE *audio_buf, *tmp_buf = NULL; DWORD flags, status; HANDLE events[2]; HRESULT hr; @@ -285,6 +285,7 @@ static DWORD CALLBACK session_worker_thread_cb( void *args ) error: ERR("The recognition session worker encountered a serious error and needs to stop. hr: %lx.\n", hr); + free(tmp_buf); return 1; }