/ Check-in [9ec40935]
Login

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

Overview
Comment:Bug fix: sqliteFree() called twice on the same allocation during error handling in attach.c. (CVS 1020)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9ec40935b9435ddc3749cab517387477e4045f6b
User & Date: drh 2003-06-14 12:04:08
Context
2003-06-14
19:29
* Added -version-info to shared libraries * Remove config.h and libtool in the distclean target (CVS 1021) check-in: e13e8b05 user: a.rottmann tags: trunk
12:04
Bug fix: sqliteFree() called twice on the same allocation during error handling in attach.c. (CVS 1020) check-in: 9ec40935 user: drh tags: trunk
11:42
Open the journal file for read-only when doing a playback. Ticket #351. (CVS 1019) check-in: 66ac7aea user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/attach.c.

     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains code used to implement the ATTACH and DETACH commands.
    13     13   **
    14         -** $Id: attach.c,v 1.6 2003/06/06 19:00:42 drh Exp $
           14  +** $Id: attach.c,v 1.7 2003/06/14 12:04:08 drh Exp $
    15     15   */
    16     16   #include "sqliteInt.h"
    17     17   
    18     18   /*
    19     19   ** This routine is called by the parser to process an ATTACH statement:
    20     20   **
    21     21   **     ATTACH DATABASE filename AS dbname
................................................................................
    60     60     if( zName==0 ) return;
    61     61     sqliteDequote(zName);
    62     62     for(i=0; i<db->nDb; i++){
    63     63       if( db->aDb[i].zName && sqliteStrICmp(db->aDb[i].zName, zName)==0 ){
    64     64         sqliteErrorMsg(pParse, "database %z is already in use", zName);
    65     65         pParse->rc = SQLITE_ERROR;
    66     66         sqliteFree(zFile);
    67         -      sqliteFree(zName);
    68     67         return;
    69     68       }
    70     69     }
    71     70   
    72     71     if( db->aDb==db->aDbStatic ){
    73     72       aNew = sqliteMalloc( sizeof(db->aDb[0])*3 );
    74     73       if( aNew==0 ) return;