Commit 5ac1eac2 authored by Tom Lane's avatar Tom Lane

Suppress memory leak in COPY WITH OIDS TO wherever.

parent 13612a97
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.115 2000/06/17 21:48:42 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.116 2000/06/28 06:05:36 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -475,10 +475,11 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim, char *null_p ...@@ -475,10 +475,11 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim, char *null_p
if (oids && !binary) if (oids && !binary)
{ {
CopySendString(DatumGetCString(DirectFunctionCall1(oidout, string = DatumGetCString(DirectFunctionCall1(oidout,
ObjectIdGetDatum(tuple->t_data->t_oid))), ObjectIdGetDatum(tuple->t_data->t_oid)));
fp); CopySendString(string, fp);
CopySendChar(delim[0], fp); CopySendChar(delim[0], fp);
pfree(string);
} }
for (i = 0; i < attr_count; i++) for (i = 0; i < attr_count; i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment