/ Check-in [b9c5dce3]
Login

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

Overview
Comment:Fix a memory leak introduced by the previous bug fix. (CVS 4876)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b9c5dce34985f7e6d1b6314ae8674f07d0bf518b
User & Date: drh 2008-03-18 00:54:22
Context
2008-03-18
13:01
Minor test coverage enhancements. (CVS 4877) check-in: edd207b9 user: drh tags: trunk
00:54
Fix a memory leak introduced by the previous bug fix. (CVS 4876) check-in: b9c5dce3 user: drh tags: trunk
00:07
Add the ability to simulate out-of-memory errors when using the default memory allocator, mem1.c. Fix a bug that this enhancement revealed. (CVS 4875) check-in: d55a5e1c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbemem.c.

    90     90           z = sqlite3DbReallocOrFree(pMem->db, pMem->z, n);
    91     91           pMem->z = 0;
    92     92           preserve = 0;
    93     93         }else{
    94     94           z = sqlite3DbMallocRaw(pMem->db, (n>32?n:32));
    95     95         }
    96     96         if( !z ){
           97  +        sqlite3VdbeMemRelease(pMem);
    97     98           pMem->flags = MEM_Null;
    98     99           return SQLITE_NOMEM;
    99    100         }
   100    101       }
   101    102   
   102    103       /* If the value is currently a string or blob and the preserve flag
   103    104       ** is true, copy the content to the new buffer.