From: Tom Lane Date: Wed, 19 Apr 2006 16:15:41 +0000 (+0000) Subject: Fix ancient memory leak in PQprintTuples(); our code no longer uses this X-Git-Tag: REL8_0_8~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8f7fce2fd6d94a3fd3dd2eb8a1a5983c57c7d1d2;p=thirdparty%2Fpostgresql.git 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. --- diff --git a/src/interfaces/libpq/fe-print.c b/src/interfaces/libpq/fe-print.c index 345ebc263eb..ee02fc3f9d6 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.58 2004/12/31 22:03:50 pgsql Exp $ + * $PostgreSQL: pgsql/src/interfaces/libpq/fe-print.c,v 1.58.4.1 2006/04/19 16:15:41 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -745,8 +745,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 */