[vlc-commits] mmdevice: mark calls that are leaking

Steve Lhomme git at videolan.org
Wed Apr 3 10:45:20 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Apr  3 09:54:57 2019 +0200| [aef7572d6902381c886e4904ecb5e965eb3b0d5b] | committer: Steve Lhomme

mmdevice: mark calls that are leaking

Given the same variable is used to set a hardcoded value or acquired_device
(which seems to be free'd properly) it may require to flag the value to tell
if it should be free'd or not.

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

 modules/audio_output/mmdevice.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index 7762ee626a..3d9f7a718c 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -756,7 +756,7 @@ static int DeviceSelectLocked(audio_output_t *aout, const char *id)
 
     if (id != NULL && strcmp(id, default_device_b) != 0)
     {
-        sys->requested_device = ToWide(id);
+        sys->requested_device = ToWide(id); /* FIXME leak */
         if (unlikely(sys->requested_device == NULL))
             return -1;
     }
@@ -1282,7 +1282,7 @@ static int Open(vlc_object_t *obj)
     char *saved_device_b = var_InheritString(aout, "mmdevice-audio-device");
     if (saved_device_b != NULL && strcmp(saved_device_b, default_device_b) != 0)
     {
-        sys->requested_device = ToWide(saved_device_b);
+        sys->requested_device = ToWide(saved_device_b); /* FIXME leak */
         free(saved_device_b);
 
         if (unlikely(sys->requested_device == NULL))



More information about the vlc-commits mailing list