diff options
author | dan <dan@noemail.net> | 2013-04-02 20:55:01 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2013-04-02 20:55:01 +0000 |
commit | 48ccef80595731d2c2b6d759455837db3113f647 (patch) | |
tree | 478c7cd70760dee34341b94eff85b9f5ea78cb45 /src/os_unix.c | |
parent | c3d53189fca4ec61a2f697ecc23bfb16328360b0 (diff) | |
download | sqlite-48ccef80595731d2c2b6d759455837db3113f647.tar.gz sqlite-48ccef80595731d2c2b6d759455837db3113f647.zip |
Fix a resource leak in os_unix.c.
FossilOrigin-Name: b29cda03fe4e8d8f5b5acbbea2d69f284a2bdf23
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 07c919c98..581afdbc9 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -4601,10 +4601,8 @@ static void unixRemapfile( } #endif - /* The attempt to extend the existing mapping failed. Free the existing - ** mapping and set pNew to NULL so that the code below will create a - ** new mapping from scratch. */ - if( pNew==MAP_FAILED ){ + /* The attempt to extend the existing mapping failed. Free it. */ + if( pNew==MAP_FAILED || pNew==0 ){ osMunmap(pOrig, nReuse); } } |