SQLite

Check-in [85b931bf72]
Login

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

Overview
Comment:Fix a memory leak that occurs after malloc fails. (CVS 2713)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 85b931bf72dac88187e4531053a06abe25d6f462
User & Date: drh 2005-09-17 17:58:22.000
Context
2005-09-17
18:02
Fix up the busy test so that it can be run multiple times in a row without giving false errors on 2nd and subsequent runs. (CVS 2714) (check-in: 7a7ba73fb5 user: drh tags: trunk)
17:58
Fix a memory leak that occurs after malloc fails. (CVS 2713) (check-in: 85b931bf72 user: drh tags: trunk)
17:05
Fix the crash.test script to accomodate recent changes. (CVS 2712) (check-in: d594608ff3 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbeaux.c.
353
354
355
356
357
358
359

360


361

362
363
364
365
366

367
368
369


370
371
372
373
374
375
376


/*
** Delete a P3 value if necessary.
*/
static void freeP3(int p3type, void *p3){
  if( p3 ){

    if( p3type==P3_DYNAMIC || p3type==P3_KEYINFO ){


      sqliteFree(p3);

    }
    if( p3type==P3_VDBEFUNC ){
      VdbeFunc *pVdbeFunc = (VdbeFunc *)p3;
      sqlite3VdbeDeleteAuxData(pVdbeFunc, 0);
      sqliteFree(pVdbeFunc);

    }
    if( p3type==P3_MEM ){
      sqlite3ValueFree((sqlite3_value*)p3);


    }
  }
}


/*
** Change the value of the P3 operand for a specific instruction.







>
|
>
>
|
>
|
|
|
|
|
>
|
|
|
>
>







353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383


/*
** Delete a P3 value if necessary.
*/
static void freeP3(int p3type, void *p3){
  if( p3 ){
    switch( p3type ){
      case P3_DYNAMIC:
      case P3_KEYINFO:
      case P3_KEYINFO_HANDOFF: {
        sqliteFree(p3);
        break;
      }
      case P3_VDBEFUNC: {
        VdbeFunc *pVdbeFunc = (VdbeFunc *)p3;
        sqlite3VdbeDeleteAuxData(pVdbeFunc, 0);
        sqliteFree(pVdbeFunc);
        break;
      }
      case P3_MEM: {
        sqlite3ValueFree((sqlite3_value*)p3);
        break;
      }
    }
  }
}


/*
** Change the value of the P3 operand for a specific instruction.