SQLite

Check-in [948f5a749f]
Login

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

Overview
Comment:fix a memory leadk (CVS 1708)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 948f5a749fdc7f40f8a8e5a4e5be8139f9e4c66d
User & Date: drh 2000-10-19 14:18:34.000
Context
2000-10-19
14:21
add the sqlite_test_prefixes control file (CVS 159) (check-in: 4ccd9103c3 user: drh tags: trunk)
14:18
fix a memory leadk (CVS 1708) (check-in: 948f5a749f user: drh tags: trunk)
14:10
Added the "memory:" driver (CVS 1707) (check-in: e9236833d9 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/dbbemem.c.
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
** This file contains code to implement the database backend (DBBE)
** for sqlite.  The database backend is the interface between
** sqlite and the code that does the actually reading and writing
** of information to the disk.
**
** This file uses an in-memory hash talbe as the database backend. 
**
** $Id: dbbemem.c,v 1.2 2000/10/19 14:10:09 drh Exp $
*/
#include "sqliteInt.h"
#include <sys/stat.h>
#include <unistd.h>
#include <ctype.h>
#include <time.h>








|







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
** This file contains code to implement the database backend (DBBE)
** for sqlite.  The database backend is the interface between
** sqlite and the code that does the actually reading and writing
** of information to the disk.
**
** This file uses an in-memory hash talbe as the database backend. 
**
** $Id: dbbemem.c,v 1.3 2000/10/19 14:18:34 drh Exp $
*/
#include "sqliteInt.h"
#include <sys/stat.h>
#include <unistd.h>
#include <ctype.h>
#include <time.h>

430
431
432
433
434
435
436

437
438
439
440
441
442
443
static void deleteMTable(MTable *p){
  ArrayElem *i;
  for(i=ArrayFirst(&p->data); i; i=ArrayNext(i)){
    void *data = ArrayData(i);
    sqliteFree(data);
  }
  ArrayClear(&p->data);

  sqliteFree(p);
}

/*
** Completely shutdown the given database.  Close all files.  Free all memory.
*/
static void sqliteMemClose(Dbbe *pDbbe){







>







430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
static void deleteMTable(MTable *p){
  ArrayElem *i;
  for(i=ArrayFirst(&p->data); i; i=ArrayNext(i)){
    void *data = ArrayData(i);
    sqliteFree(data);
  }
  ArrayClear(&p->data);
  sqliteFree(p->zName);
  sqliteFree(p);
}

/*
** Completely shutdown the given database.  Close all files.  Free all memory.
*/
static void sqliteMemClose(Dbbe *pDbbe){