# HG changeset patch # User al # Date 1091535674 0 # Node ID abe577c2b12e0fc35ddfadbc6036992ea88d5959 # Parent 876bcf9840978b436f1096f94574efe440e33b28 Corrected my mistake in the last memfix patch. Bug was discovered by Shachar Raindel . The basic patch idea is also from him. diff -r 876bcf984097 -r abe577c2b12e input/input.c --- a/input/input.c Tue Aug 03 11:25:18 2004 +0000 +++ b/input/input.c Tue Aug 03 12:21:14 2004 +0000 @@ -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) {