[vlc-devel] [PATCH 1/2] audio_output/winstore: fix free of the default device

Steve Lhomme robux4 at ycbcr.xyz
Tue Nov 24 09:20:39 CET 2020


It must be free'd with CoTaskMemFree and only once.
---
 modules/audio_output/winstore.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/audio_output/winstore.c b/modules/audio_output/winstore.c
index 021be7567fc..07c4422f410 100644
--- a/modules/audio_output/winstore.c
+++ b/modules/audio_output/winstore.c
@@ -566,7 +566,8 @@ static void Close(vlc_object_t *obj)
     assert(sys->refs == 0);
 
     free(sys->acquired_device);
-    free(sys->requested_device);
+    if (sys->requested_device != sys->default_device)
+        free(sys->requested_device);
     CoTaskMemFree(sys->default_device);
     DeleteCriticalSection(&sys->lock);
 
-- 
2.26.2



More information about the vlc-devel mailing list