# HG changeset patch # User Thomas Klausner # Date 1362905877 -3600 # Node ID bbc08d58325a23fb6d56410c2b63d43107232bf3 # Parent 992ef11673445a6cc4c810205680b1f127f0f8bd# Parent 6e7437162f268bf17f0bf7a3d074f0e1f55070b9 merge diff -r 992ef1167344 -r bbc08d58325a libfdcore/fdd.y --- a/libfdcore/fdd.y Sat Mar 09 16:55:20 2013 +0100 +++ b/libfdcore/fdd.y Sun Mar 10 09:57:57 2013 +0100 @@ -322,15 +322,18 @@ CHECK_MALLOC_DO( fname = malloc( strlen(bkp) + strlen(DEFAULT_EXTENSIONS_PATH) + 2 ), { yyerror (&yylloc, conf, "Not enough memory"); YYERROR; } ); sprintf(fname, DEFAULT_EXTENSIONS_PATH "/%s", bkp); - free(bkp); fd = fopen(fname, "r"); + if (fd == NULL) { + free(fname); + fname = bkp; + } else { + free(bkp); + } } - if (fd == NULL) { - int ret = errno; - TRACE_DEBUG_ERROR("WARNING: Unable to open extension file %s for reading: %s\nLD_LIBRARY_PATH will be used.\n", fname, strerror(ret)); - } else { + if (fd != NULL) { fclose(fd); - } + } /* otherwise, LD_LIBRARY_PATH will be tested by dl_open. + This should not give any security issue, otherwise we can add an "else fail" here. */ /* Try and open the configuration file (optional) */ cfname = $4;