1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Fix a memory leak that was discovered by the tests that were added to

cover ticket #2339. (CVS 4069)

FossilOrigin-Name: 1d10a489340718cc708e11e28e7bb31c67e00ad8
This commit is contained in:
drh
2007-06-15 15:31:49 +00:00
parent ca306519bc
commit 5bd1bf2ebc
3 changed files with 12 additions and 9 deletions

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
** $Id: select.c,v 1.350 2007/06/07 10:55:36 drh Exp $
** $Id: select.c,v 1.351 2007/06/15 15:31:50 drh Exp $
*/
#include "sqliteInt.h"
@@ -1771,6 +1771,9 @@ static int multiSelect(
pOffset = p->pOffset;
p->pOffset = 0;
rc = sqlite3Select(pParse, p, op, unionTab, 0, 0, 0, aff);
/* Query flattening in sqlite3Select() might refill p->pOrderBy.
** Be sure to delete p->pOrderBy, therefore, to avoid a memory leak. */
sqlite3ExprListDelete(p->pOrderBy);
p->pPrior = pPrior;
p->pOrderBy = pOrderBy;
sqlite3ExprDelete(p->pLimit);