[vlc-commits] auhal: fix minor memory leak when handling SPDIF devices

David Fuhrmann git at videolan.org
Sat Feb 16 20:45:38 CET 2013


vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Sat Feb 16 20:45:22 2013 +0100| [8b47d5a797a7e8dda7c40db634cf29ff040e3d73] | committer: Felix Paul Kühne

auhal: fix minor memory leak when handling SPDIF devices

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

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

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

diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index d3ba347..18a0d5a 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -1016,9 +1016,11 @@ static void RebuildDeviceList(audio_output_t * p_aout)
         if (AudioDeviceSupportsDigital(p_aout, deviceIDs[i])) {
             b_digital = true;
             msg_Dbg(p_aout, "'%s' supports digital output", psz_name);
-            asprintf(&psz_name, _("%s (Encoded Output)"), psz_name);
+            char *psz_encoded_name = nil;
+            asprintf(&psz_encoded_name, _("%s (Encoded Output)"), psz_name);
             i_id = i_id | AOUT_VAR_SPDIF_FLAG;
-            add_device_to_list(p_aout, i_id, psz_name);
+            add_device_to_list(p_aout, i_id, psz_encoded_name);
+            free(psz_encoded_name);
         }
 
         CFRelease(device_name_ref);



More information about the vlc-commits mailing list