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

Fix handling of a failed malloc() in various places (CVS 1605)

FossilOrigin-Name: b739ef2a1b8f7cfee4ab3f4c1319c159bd1e2e40
This commit is contained in:
danielk1977
2004-06-16 10:39:52 +00:00
parent 5c4c77878d
commit 8def5ea203
6 changed files with 35 additions and 27 deletions

View File

@@ -720,7 +720,9 @@ static char *base_vprintf(
if( xRealloc ){
if( sM.zText==sM.zBase ){
sM.zText = xRealloc(0, sM.nChar+1);
memcpy(sM.zText, sM.zBase, sM.nChar+1);
if( sM.zText ){
memcpy(sM.zText, sM.zBase, sM.nChar+1);
}
}else if( sM.nAlloc>sM.nChar+10 ){
sM.zText = xRealloc(sM.zText, sM.nChar+1);
}