Skip to content

Commit d914334

Browse files
committed
Back-patch COPY WITH OIDS leak fix.
1 parent 97f41da commit d914334

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/commands/copy.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.106.2.1 2000/06/05 11:13:55 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.106.2.2 2000/06/28 06:13:01 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -484,8 +484,10 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim, char *null_p
484484

485485
if (oids && !binary)
486486
{
487-
CopySendString(oidout(tuple->t_data->t_oid), fp);
487+
string = oidout(tuple->t_data->t_oid);
488+
CopySendString(string, fp);
488489
CopySendChar(delim[0], fp);
490+
pfree(string);
489491
}
490492

491493
for (i = 0; i < attr_count; i++)

0 commit comments

Comments
 (0)