SQLite

Check-in [254ac2213e]
Login

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

Overview
Comment:Fix a memory leak. Ticket #1259. (CVS 2472)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 254ac2213e695ead065ba3807d5d285046212fe1
User & Date: drh 2005-05-22 19:21:52.000
Context
2005-05-22
20:12
Never user a pointer to standard library routines malloc() and free(). This rule is to work around limitations of MSVC and the _fastcall calling convention. Ticket #1256. (CVS 2473) (check-in: a39c446726 user: drh tags: trunk)
19:21
Fix a memory leak. Ticket #1259. (CVS 2472) (check-in: 254ac2213e user: drh tags: trunk)
10:44
Add hook to register SSE user-functions. (CVS 2471) (check-in: 20bd303e8c user: danielk1977 tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbemem.c.
604
605
606
607
608
609
610
611


612



613
614
615
616
617
618
619
      rc = sqlite3BtreeKey(pCur, offset, amt, zData);
    }else{
      rc = sqlite3BtreeData(pCur, offset, amt, zData);
    }
    zData[amt] = 0;
    zData[amt+1] = 0;
    if( rc!=SQLITE_OK ){
      if( amt>NBFS ){


        sqliteFree(zData);



      }
      return rc;
    }
  }

  return SQLITE_OK;
}







|
>
>

>
>
>







604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
      rc = sqlite3BtreeKey(pCur, offset, amt, zData);
    }else{
      rc = sqlite3BtreeData(pCur, offset, amt, zData);
    }
    zData[amt] = 0;
    zData[amt+1] = 0;
    if( rc!=SQLITE_OK ){
      if( amt>NBFS-2 ){
        assert( zData!=pMem->zShort );
        assert( pMem->flags & MEM_Dyn );
        sqliteFree(zData);
      } else {
        assert( zData==pMem->zShort );
        assert( pMem->flags & MEM_Short );
      }
      return rc;
    }
  }

  return SQLITE_OK;
}