/ Check-in [c249d5da]
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:Avoid leaking a file descriptor after a malloc failure on unix. (CVS 4518)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c249d5da721b32f6fe409a5b55a5d49a58994fec
User & Date: danielk1977 2007-10-30 17:28:52
Context
2007-11-01
17:38
Add a prototype "group_concat()" aggregate function to func.c. Disabled by default. No documentation nor test cases. No effort to make it efficient. (CVS 4519) check-in: 61987a89 user: drh tags: trunk
2007-10-30
17:28
Avoid leaking a file descriptor after a malloc failure on unix. (CVS 4518) check-in: c249d5da user: danielk1977 tags: trunk
15:38
Remove a debugging assert() that went in by accident with the previous commit. (CVS 4517) check-in: 4ad60bdb user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

  2264   2264     fcntl(h, F_SETFD, fcntl(h, F_GETFD, 0) | FD_CLOEXEC);
  2265   2265   #endif
  2266   2266   
  2267   2267     enterMutex();
  2268   2268     rc = findLockInfo(h, &pNew->pLock, &pNew->pOpen);
  2269   2269     leaveMutex();
  2270   2270     if( rc ){
         2271  +    if( dirfd>=0 ) close(dirfd);
  2271   2272       close(h);
  2272   2273       return SQLITE_NOMEM;
  2273   2274     }
  2274   2275   
  2275   2276     OSTRACE3("OPEN    %-3d %s\n", h, zFilename);
  2276   2277     pNew->dirfd = -1;
  2277   2278     pNew->h = h;