mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Clean up possible memory leakage in nodeSubplan
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.95 1999/11/15 02:00:01 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.96 1999/11/15 03:28:06 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -551,6 +551,10 @@ _copySubPlan(SubPlan *from)
|
||||
newnode->parParam = listCopy(from->parParam);
|
||||
Node_Copy(from, newnode, sublink);
|
||||
|
||||
/* do not copy execution state */
|
||||
newnode->shutdown = false;
|
||||
newnode->curTuple = NULL;
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.50 1999/10/07 04:23:04 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.51 1999/11/15 03:28:06 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -406,9 +406,13 @@ _equalIndexScan(IndexScan *a, IndexScan *b)
|
||||
static bool
|
||||
_equalSubPlan(SubPlan *a, SubPlan *b)
|
||||
{
|
||||
/* should compare plans, but have to settle for comparing plan IDs */
|
||||
if (a->plan_id != b->plan_id)
|
||||
return false;
|
||||
|
||||
if (!equal(a->rtable, b->rtable))
|
||||
return false;
|
||||
|
||||
if (!equal(a->sublink, b->sublink))
|
||||
return false;
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.26 1999/08/21 03:48:57 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.27 1999/11/15 03:28:07 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -441,6 +441,9 @@ _freeSubPlan(SubPlan *node)
|
||||
freeList(node->parParam);
|
||||
freeObject(node->sublink);
|
||||
|
||||
if (node->curTuple)
|
||||
pfree(node->curTuple);
|
||||
|
||||
pfree(node);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user