diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-04-19 16:15:29 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-04-19 16:15:29 +0000 |
commit | 8f52496a05e83666bcf8b32c6e525cc6730fd78b (patch) | |
tree | 0ee18c40a0c705cd1bf27dc195779ce8f9a94ba3 /src/interfaces/libpq/fe-print.c | |
parent | 3224f2ee250cf5b53dc201d850b03d1e319f1782 (diff) | |
download | postgresql-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.c | 6 |
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 */ |