Skip to content

Commit

Permalink
Further reforms to Tcl_*Alloc() usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Mistachkin committed Feb 15, 2017
1 parent 4604f9c commit e5f08d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/tclsqlite.c
Original file line number Diff line number Diff line change
Expand Up @@ -3405,10 +3405,6 @@ static int SQLITE_TCLAPI DbMain(
}
zErrMsg = 0;
p = (SqliteDb*)Tcl_Alloc( sizeof(*p) );
if( p==0 ){
Tcl_SetResult(interp, (char *)"malloc failed", TCL_STATIC);
return TCL_ERROR;
}
memset(p, 0, sizeof(*p));
zFile = Tcl_GetStringFromObj(objv[2], 0);
zFile = Tcl_TranslateFileName(interp, zFile, &translatedFilename);
Expand Down
4 changes: 2 additions & 2 deletions src/test6.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ static CrashGlobal g = {0, 0, SQLITE_DEFAULT_SECTOR_SIZE, 0, 0};
static int sqlite3CrashTestEnable = 0;

static void *crash_malloc(int nByte){
return (void *)Tcl_Alloc((size_t)nByte);
return (void *)Tcl_AttemptAlloc((size_t)nByte);
}
static void crash_free(void *p){
Tcl_Free(p);
}
static void *crash_realloc(void *p, int n){
return (void *)Tcl_Realloc(p, (size_t)n);
return (void *)Tcl_AttemptRealloc(p, (size_t)n);
}

/*
Expand Down

0 comments on commit e5f08d7

Please sign in to comment.