[vlc-commits] ttml demux: Remove useless string duplication

Hugo Beauzée-Luyssen git at videolan.org
Wed Sep 14 18:39:45 CEST 2016


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Sep 13 12:05:58 2016 +0200| [6b1fe420b243e5ce92f62f647702db4e91ac426c] | committer: Hugo Beauzée-Luyssen

ttml demux: Remove useless string duplication

And the memory leak that goes with it

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

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

diff --git a/modules/demux/ttml.c b/modules/demux/ttml.c
index 73aab98..8b5e990 100644
--- a/modules/demux/ttml.c
+++ b/modules/demux/ttml.c
@@ -461,8 +461,8 @@ static int ParseTimeOnSpan( demux_sys_t* p_sys, char* psz_text )
                 ClearNode( p_node );
                 goto error;
             }
-
-            if ( asprintf( &pp_subtitles[i_nb_span]->psz_text, "%s", NodeToStr( p_node ) ) < 0 )
+            pp_subtitles[i_nb_span]->psz_text = NodeToStr( p_node );
+            if( pp_subtitles[i_nb_span] == NULL )
             {
                 ClearNode( p_node );
                 goto error;



More information about the vlc-commits mailing list