[vlc-devel] [PATCH 1/2] lib/media_player: libvlc_get_track_description: fix return-value on error

Filip Roséen filip at atch.se
Wed Mar 15 10:09:55 CET 2017


p_track_description is returned when goto end is executed, meaning
that we would return a non-NULL value that has already been released
by the call to libvlc_track_description_list_release.
---
 lib/media_player.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/media_player.c b/lib/media_player.c
index 4619ed23d9..0487cc8b97 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -1807,6 +1807,8 @@ libvlc_track_description_t *
             {
                 libvlc_track_description_list_release( p_track_description );
                 libvlc_printerr( "Not enough memory" );
+
+                p_track_description = NULL;
                 goto end;
             }
         }
-- 
2.12.0


More information about the vlc-devel mailing list