aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-print.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-04-19 16:15:29 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-04-19 16:15:29 +0000
commit8f52496a05e83666bcf8b32c6e525cc6730fd78b (patch)
tree0ee18c40a0c705cd1bf27dc195779ce8f9a94ba3 /src/interfaces/libpq/fe-print.c
parent3224f2ee250cf5b53dc201d850b03d1e319f1782 (diff)
downloadpostgresql-8f52496a05e83666bcf8b32c6e525cc6730fd78b.tar.gz
postgresql-8f52496a05e83666bcf8b32c6e525cc6730fd78b.zip
Fix ancient memory leak in PQprintTuples(); our code no longer uses this
routine, but perhaps some applications do. Found by Martijn van Oosterhout using Coverity.
Diffstat (limited to 'src/interfaces/libpq/fe-print.c')
-rw-r--r--src/interfaces/libpq/fe-print.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/interfaces/libpq/fe-print.c b/src/interfaces/libpq/fe-print.c
index f57d77bc91c..7a1e032fb7f 100644
--- a/src/interfaces/libpq/fe-print.c
+++ b/src/interfaces/libpq/fe-print.c
@@ -10,7 +10,7 @@
* didn't really belong there.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-print.c,v 1.67 2006/03/05 15:59:09 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-print.c,v 1.68 2006/04/19 16:15:29 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -751,8 +751,10 @@ PQprintTuples(const PGresult *res,
fprintf(fout, "|\n%s\n", tborder);
}
}
-}
+ if (tborder)
+ free(tborder);
+}
/* simply send out max-length number of filler characters to fp */