Skip to content

Commit 7fc7551

Browse files
Jan WieckJan Wieck
authored andcommitted
Fixed growing of backend due to not pfree()'d data on COPY FROM
Fixed growing of backend if BEFORE DELETE trigger returns heap tuple different from trigtuple. Jan
1 parent 072be47 commit 7fc7551

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/backend/commands/copy.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
*
88
* IDENTIFICATION
9-
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.68 1999/01/23 22:27:26 tgl Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.69 1999/02/01 20:25:54 wieck Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -651,7 +651,6 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
651651
lineno = 0;
652652
while (!done)
653653
{
654-
values = (Datum *) palloc(sizeof(Datum) * attr_count);
655654
if (!binary)
656655
{
657656
#ifdef COPY_PATCH

src/backend/commands/trigger.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,8 @@ ExecBRDeleteTriggers(EState *estate, ItemPointer tupleid)
684684
newtuple = ExecCallTriggerFunc(trigger[i]);
685685
if (newtuple == NULL)
686686
break;
687+
if (newtuple != trigtuple)
688+
pfree(newtuple);
687689
}
688690
CurrentTriggerData = NULL;
689691
pfree(SaveTriggerData);

0 commit comments

Comments
 (0)