1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-21 18:57:35 +00:00

Corrected my mistake in the last memfix patch.

Bug was discovered by Shachar Raindel <shacharr@gmail.com>.
The basic patch idea is also from him.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12943 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
al 2004-08-03 12:21:14 +00:00
parent 50570ae820
commit 0f6c8c765a

View File

@ -1484,15 +1484,24 @@ mp_input_init(void) {
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) {