1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

Fix another OOM related problem in fkey.c.

FossilOrigin-Name: e2bc51bc61d54d103ccffd12106c27a574e4e997
This commit is contained in:
dan
2009-09-22 16:55:38 +00:00
parent 934ce300a0
commit f59c5cacb8
6 changed files with 77 additions and 53 deletions

View File

@@ -2233,7 +2233,10 @@ void sqlite3CreateForeignKey(
pNextTo = (FKey *)sqlite3HashInsert(&p->pSchema->fkeyHash,
pFKey->zTo, sqlite3Strlen30(pFKey->zTo), (void *)pFKey
);
if( pNextTo==pFKey ) goto fk_end;
if( pNextTo==pFKey ){
db->mallocFailed = 1;
goto fk_end;
}
if( pNextTo ){
assert( pNextTo->pPrevTo==0 );
pFKey->pNextTo = pNextTo;