/ 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 Unified Diffs Ignore Whitespace Patch

Changes to src/vdbemem.c.

90
91
92
93
94
95
96

97
98
99
100
101
102
103
        z = sqlite3DbReallocOrFree(pMem->db, pMem->z, n);
        pMem->z = 0;
        preserve = 0;
      }else{
        z = sqlite3DbMallocRaw(pMem->db, (n>32?n:32));
      }
      if( !z ){

        pMem->flags = MEM_Null;
        return SQLITE_NOMEM;
      }
    }

    /* If the value is currently a string or blob and the preserve flag
    ** is true, copy the content to the new buffer. 







>







90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
        z = sqlite3DbReallocOrFree(pMem->db, pMem->z, n);
        pMem->z = 0;
        preserve = 0;
      }else{
        z = sqlite3DbMallocRaw(pMem->db, (n>32?n:32));
      }
      if( !z ){
        sqlite3VdbeMemRelease(pMem);
        pMem->flags = MEM_Null;
        return SQLITE_NOMEM;
      }
    }

    /* If the value is currently a string or blob and the preserve flag
    ** is true, copy the content to the new buffer.