[MPlayer-cvslog] r25342 - trunk/libmpdemux/demuxer.c

ulion subversion at mplayerhq.hu
Mon Dec 10 15:43:09 CET 2007


Author: ulion
Date: Mon Dec 10 15:43:09 2007
New Revision: 25342

Log:
Fix memory leak that tmp allocated but maybe not used.


Modified:
   trunk/libmpdemux/demuxer.c

Modified: trunk/libmpdemux/demuxer.c
==============================================================================
--- trunk/libmpdemux/demuxer.c	(original)
+++ trunk/libmpdemux/demuxer.c	Mon Dec 10 15:43:09 2007
@@ -1170,11 +1170,13 @@ int demuxer_seek_chapter(demuxer_t *demu
         }
 
         if(chapter_name) {
-            char *tmp = malloc(16);
             *chapter_name = NULL;
-            if(num_chapters  && *num_chapters && tmp) {
-                sprintf(tmp, " of %3d", *num_chapters);
-                *chapter_name = tmp;
+            if (num_chapters && *num_chapters) {
+                char *tmp = malloc(16);
+                if (tmp) {
+                    sprintf(tmp, " of %3d", *num_chapters);
+                    *chapter_name = tmp;
+                }
             }
         }
 



More information about the MPlayer-cvslog mailing list