[vlc-commits] audio_output/winstore: fix free of the default device

Steve Lhomme git at videolan.org
Wed Nov 25 07:20:26 CET 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Nov 24 08:56:33 2020 +0100| [4bc2b28f0a47273fb3b4e59304542847c3f6c66a] | committer: Steve Lhomme

audio_output/winstore: fix free of the default device

It must be free'd with CoTaskMemFree and only once.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4bc2b28f0a47273fb3b4e59304542847c3f6c66a
---

 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 021be7567f..07c4422f41 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);
 



More information about the vlc-commits mailing list