[MPlayer-dev-eng] [PATCH] demux_ogg memleak/fix to my last patch

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Apr 30 00:44:33 CEST 2005


Hi,
it seems like I did some nonsense in my last demux_ogg.c memleak-patch.
Calling demux_close_ogg before returning from open in case of failure
makes no sense, since that function will be called anyway from demuxer.c
Instead the local ogg_d memory should be free - which can be achieved by
assigning it at once to demuxer->priv.
Does it look okay to you?

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libmpdemux/demux_ogg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_ogg.c,v
retrieving revision 1.68
diff -u -r1.68 demux_ogg.c
--- libmpdemux/demux_ogg.c	27 Feb 2005 18:11:16 -0000	1.68
+++ libmpdemux/demux_ogg.c	29 Apr 2005 22:36:20 -0000
@@ -756,6 +756,7 @@
   clear_sub = -1;
   s = demuxer->stream;
 
+  demuxer->priv =
   ogg_d = (ogg_demuxer_t*)calloc(1,sizeof(ogg_demuxer_t));
   sync = &ogg_d->sync;
   page = &ogg_d->page;
@@ -1063,9 +1064,6 @@
     goto err_out;
   }
 
-  /// Finish to setup the demuxer
-  demuxer->priv = ogg_d;
-
   if(!n_video || (video_id < 0))
     demuxer->video->id = -2;
   else
@@ -1099,7 +1097,6 @@
   return 1;
 
 err_out:
-  demux_close_ogg(demuxer);
   return 0;
 }
 


More information about the MPlayer-dev-eng mailing list