From 5701b05e0fc36a6f9e34922bd8a1ff73c3b93c52 Mon Sep 17 00:00:00 2001 From: dmitrykos Date: Mon, 2 Apr 2012 12:25:14 +0000 Subject: [PATCH] wasapi: zero wasapi host api rep immediately after init. prevents (unlikely) issue with trying to free uninited allocations if com init fails during Pa_Initialize() (Ross Bencina) --- src/hostapi/wasapi/pa_win_wasapi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hostapi/wasapi/pa_win_wasapi.c b/src/hostapi/wasapi/pa_win_wasapi.c index 279b5fb..ee775c7 100644 --- a/src/hostapi/wasapi/pa_win_wasapi.c +++ b/src/hostapi/wasapi/pa_win_wasapi.c @@ -1065,6 +1065,8 @@ PaError PaWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd result = paInsufficientMemory; goto error; } + + memset( paWasapi, 0, sizeof(PaWasapiHostApiRepresentation) ); /* ensure all fields are zeroed. especially paWasapi->allocations */ result = PaWinUtil_CoInitialize( paWASAPI, &paWasapi->comInitializationResult ); if( result != paNoError ) -- 2.43.0