/ Check-in [e95cf2c5]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a total unimportant file descriptor leak in lemon. This is to silence warning messages.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e95cf2c576dda656c0f31eeec3d98e911b9003a1
User & Date: drh 2011-08-30 00:58:58
Context
2011-08-30
01:23
Make sure SQLITE_FCNTL_SIZE_HINT a no-op if the chunk size is not greater than zero. check-in: 88b763e8 user: mistachkin tags: trunk
00:58
Fix a total unimportant file descriptor leak in lemon. This is to silence warning messages. check-in: e95cf2c5 user: drh tags: trunk
00:53
Fix a buffer overrun in test logic. No impact on the core SQLite. check-in: 49cd60e3 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/lemon.c.

  2518   2518     filesize = ftell(fp);
  2519   2519     rewind(fp);
  2520   2520     filebuf = (char *)malloc( filesize+1 );
  2521   2521     if( filebuf==0 ){
  2522   2522       ErrorMsg(ps.filename,0,"Can't allocate %d of memory to hold this file.",
  2523   2523         filesize+1);
  2524   2524       gp->errorcnt++;
         2525  +    fclose(fp);
  2525   2526       return;
  2526   2527     }
  2527   2528     if( fread(filebuf,1,filesize,fp)!=filesize ){
  2528   2529       ErrorMsg(ps.filename,0,"Can't read in all %d bytes of this file.",
  2529   2530         filesize);
  2530   2531       free(filebuf);
  2531   2532       gp->errorcnt++;
         2533  +    fclose(fp);
  2532   2534       return;
  2533   2535     }
  2534   2536     fclose(fp);
  2535   2537     filebuf[filesize] = 0;
  2536   2538   
  2537   2539     /* Make an initial pass through the file to handle %ifdef and %ifndef */
  2538   2540     preprocess_input(filebuf);