SQLite

Check-in [bad661bb0b]
Login

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

Overview
Comment:Fix a page leak in btree balance routines that follows a malloc failure. This problem detected by the new soft-heap-limit testing. (CVS 4214)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bad661bb0bfabf982a2d711ea4165af130a4cae0
User & Date: drh 2007-08-13 14:56:44.000
Context
2007-08-13
15:18
Disable tests that require 80-bit long doubles when the host only provides 64-bit long doubles. Ticket #2570. (CVS 4215) (check-in: 4f4f8ef416 user: drh tags: trunk)
14:56
Fix a page leak in btree balance routines that follows a malloc failure. This problem detected by the new soft-heap-limit testing. (CVS 4214) (check-in: bad661bb0b user: drh tags: trunk)
14:41
When loading a database schema, do not clear the SQLITE_InternChanges flag. This fixes the problem illustrated by (4211). (CVS 4213) (check-in: 540a7b28bc user: danielk1977 tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/btree.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
** 2004 April 6
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.395 2007/08/07 17:13:04 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
** Including a description of file format and an overview of operation.
*/
#include "btreeInt.h"












|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
** 2004 April 6
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.396 2007/08/13 14:56:44 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
** Including a description of file format and an overview of operation.
*/
#include "btreeInt.h"

4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
        rc = ptrmapPutOvfl(pPage, i);
        if( rc!=SQLITE_OK ){
          goto end_shallow_balance;
        }
      }
    }
#endif
    if( rc!=SQLITE_OK ) goto end_shallow_balance;
    releasePage(pChild);
  }
end_shallow_balance:
  sqliteFree(apCell);
  return rc;
}








<







4961
4962
4963
4964
4965
4966
4967

4968
4969
4970
4971
4972
4973
4974
        rc = ptrmapPutOvfl(pPage, i);
        if( rc!=SQLITE_OK ){
          goto end_shallow_balance;
        }
      }
    }
#endif

    releasePage(pChild);
  }
end_shallow_balance:
  sqliteFree(apCell);
  return rc;
}