[Mplayer-cvslog] CVS: main/input input.c,1.91,1.92

Alexander Strasser beastd syncmail at mplayerhq.hu
Tue Aug 3 14:21:17 CEST 2004


CVS change done by Alexander Strasser (beastd)

Update of /cvsroot/mplayer/main/input
In directory mail:/var2/tmp/cvs-serv30898/input

Modified Files:
	input.c 
Log Message:
Corrected my mistake in the last memfix patch.
Bug was discovered by Shachar Raindel <shacharr at gmail.com>.
The basic patch idea is also from him.


Index: input.c
===================================================================
RCS file: /cvsroot/mplayer/main/input/input.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -r1.91 -r1.92
--- input.c	23 Jul 2004 16:10:21 -0000	1.91
+++ input.c	3 Aug 2004 12:21:14 -0000	1.92
@@ -1484,15 +1484,24 @@
   if(!file)
     return;
   
-  if( mp_input_parse_config(file)) {
-    free(file); // release the buffer created by get_path()
-  }
-  else {
+  if( !mp_input_parse_config(file)) {
+    // free file if it was allocated by get_path(),
+    // before it gets overwritten
+    if( file != config_file)
+    {
+      free(file);
+    }
     // Try global conf dir
     file = MPLAYER_CONFDIR "/input.conf";
     if(! mp_input_parse_config(file))
       mp_msg(MSGT_INPUT,MSGL_WARN,"Falling back on default (hardcoded) input config\n");
   }
+  else
+  {
+    // free file if it was allocated by get_path()
+    if( file != config_file)
+      free(file);
+  }
 
 #ifdef HAVE_JOYSTICK
   if(use_joystick) {




More information about the MPlayer-cvslog mailing list