/ Check-in [846f9739]
Login

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

Overview
Comment:Set flags = MEM_Null on allocation failure in sqlite3VdbeMemGrow (CVS 4953)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 846f9739d3e288dc81e40f5bfab046bd80bb22b2
User & Date: mlcreech 2008-04-02 04:23:32
Context
2008-04-02
16:29
Simplifications to the LockTable opcode. (CVS 4954) check-in: 66c5d715 user: drh tags: trunk
04:23
Set flags = MEM_Null on allocation failure in sqlite3VdbeMemGrow (CVS 4953) check-in: 846f9739 user: mlcreech tags: trunk
2008-04-01
18:04
Avoid factoring single-instruction constants that end up getting replaced by an SCopy instruction. (CVS 4952) check-in: e84ff57b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbemem.c.

    80     80       ((pMem->flags&MEM_Static) ? 1 : 0)
    81     81     );
    82     82   
    83     83     if( !pMem->zMalloc || sqlite3MallocSize(pMem->zMalloc)<n ){
    84     84       n = (n>32?n:32);
    85     85       if( preserve && pMem->z==pMem->zMalloc ){
    86     86         pMem->z = pMem->zMalloc = sqlite3DbReallocOrFree(pMem->db, pMem->z, n);
           87  +      if ( !pMem->z )
           88  +        pMem->flags = MEM_Null;
    87     89         preserve = 0;
    88     90       }else{
    89     91         sqlite3_free(pMem->zMalloc);
    90     92         pMem->zMalloc = sqlite3DbMallocRaw(pMem->db, n);
    91     93       }
    92     94     }
    93     95