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

Changes to src/vdbemem.c.

80
81
82
83
84
85
86


87
88
89
90
91
92
93
    ((pMem->flags&MEM_Static) ? 1 : 0)
  );

  if( !pMem->zMalloc || sqlite3MallocSize(pMem->zMalloc)<n ){
    n = (n>32?n:32);
    if( preserve && pMem->z==pMem->zMalloc ){
      pMem->z = pMem->zMalloc = sqlite3DbReallocOrFree(pMem->db, pMem->z, n);


      preserve = 0;
    }else{
      sqlite3_free(pMem->zMalloc);
      pMem->zMalloc = sqlite3DbMallocRaw(pMem->db, n);
    }
  }








>
>







80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
    ((pMem->flags&MEM_Static) ? 1 : 0)
  );

  if( !pMem->zMalloc || sqlite3MallocSize(pMem->zMalloc)<n ){
    n = (n>32?n:32);
    if( preserve && pMem->z==pMem->zMalloc ){
      pMem->z = pMem->zMalloc = sqlite3DbReallocOrFree(pMem->db, pMem->z, n);
      if ( !pMem->z )
        pMem->flags = MEM_Null;
      preserve = 0;
    }else{
      sqlite3_free(pMem->zMalloc);
      pMem->zMalloc = sqlite3DbMallocRaw(pMem->db, n);
    }
  }