SQLite

Check-in [b29cda03fe]
Login

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

Overview
Comment:Fix a resource leak in os_unix.c.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | experimental-mmap
Files: files | file ages | folders
SHA1: b29cda03fe4e8d8f5b5acbbea2d69f284a2bdf23
User & Date: dan 2013-04-02 20:55:01.697
Context
2013-04-03
00:42
Fix the unix driver to check defined(_BSD_SOURCE) rather than just the plain _BSD_SOURCE macro. This fixes the build for OpenBSD. (check-in: 1dd42ef414 user: drh tags: experimental-mmap)
2013-04-02
20:55
Fix a resource leak in os_unix.c. (check-in: b29cda03fe user: dan tags: experimental-mmap)
20:29
Adjustments to mmap1.test so that it works better on windows. It still gets some answers wrong, but it no longer crashes. (check-in: ee8d3ceeec user: drh tags: experimental-mmap)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to src/os_unix.c.
4597
4598
4599
4600
4601
4602
4603
4604

4605
4606
4607

4608
4609
4610
4611
4612
4613
4614
4597
4598
4599
4600
4601
4602
4603

4604



4605
4606
4607
4608
4609
4610
4611
4612







-
+
-
-
-
+







        pNew = 0;
      }else{
        pNew = pOrig;
      }
    }
#endif

    /* The attempt to extend the existing mapping failed. Free the existing
    /* The attempt to extend the existing mapping failed. Free it. */
    ** mapping and set pNew to NULL so that the code below will create a
    ** new mapping from scratch.  */
    if( pNew==MAP_FAILED ){
    if( pNew==MAP_FAILED || pNew==0 ){
      osMunmap(pOrig, nReuse);
    }
  }

  /* If pNew is still NULL, try to create an entirely new mapping. */
  if( pNew==0 ){
    pNew = osMmap(0, nNew, flags, MAP_SHARED, h, 0);