diff options
author | dan <dan@noemail.net> | 2019-08-20 14:43:01 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2019-08-20 14:43:01 +0000 |
commit | 4780b9ad46ebf5b9a2628cd80ef2ec95a6566f56 (patch) | |
tree | 9449586dca55ff2ef5941fb4684b9326da88bb73 /src/expr.c | |
parent | 95da9d5d46a1df00053191dfce9758dbda434e07 (diff) | |
download | sqlite-4780b9ad46ebf5b9a2628cd80ef2ec95a6566f56.tar.gz sqlite-4780b9ad46ebf5b9a2628cd80ef2ec95a6566f56.zip |
Fix a segfault that could occur following an OOM while processing a SELECT statement for which one or more of the expressions in the window frame declaration are themselves sub-selects that use window functions.
FossilOrigin-Name: 75aec4fc886c04fe098828cc03bc72c197cbf40f0a1890fe5bbb98d4fd5c3c7e
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/expr.c b/src/expr.c index 41cc2724f..c9deef0b6 100644 --- a/src/expr.c +++ b/src/expr.c @@ -1511,7 +1511,7 @@ Select *sqlite3SelectDup(sqlite3 *db, Select *pDup, int flags){ #ifndef SQLITE_OMIT_WINDOWFUNC pNew->pWin = 0; pNew->pWinDefn = sqlite3WindowListDup(db, p->pWinDefn); - if( p->pWin ) gatherSelectWindows(pNew); + if( p->pWin && db->mallocFailed==0 ) gatherSelectWindows(pNew); #endif pNew->selId = p->selId; *pp = pNew; |