diff options
author | Neil Conway <neilc@samurai.com> | 2006-11-08 01:22:55 +0000 |
---|---|---|
committer | Neil Conway <neilc@samurai.com> | 2006-11-08 01:22:55 +0000 |
commit | 415b925345ef99adaab31af89787a2c0814fcffa (patch) | |
tree | 5823fc8fc0db2e32ff710835e33fc884028f6c09 /src | |
parent | 8964b41c7b88bb1acc7bb9811ca8cb4938c7a410 (diff) | |
download | postgresql-415b925345ef99adaab31af89787a2c0814fcffa.tar.gz postgresql-415b925345ef99adaab31af89787a2c0814fcffa.zip |
Fix a memory leak in psql: we'd leak a few PGresult handles if
a connectivity error occurred while executing one of the queries
for "\d <table>". Not serious, but still worth fixing. Patch from
Brendan Jurd.
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/psql/describe.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index bab0e24f957..2e526d44107 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2006, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.147 2006/10/09 23:30:33 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.148 2006/11/08 01:22:55 neilc Exp $ */ #include "postgres_fe.h" #include "describe.h" @@ -1171,7 +1171,14 @@ describeOneTableDetails(const char *schemaname, result6 = PSQLexec(buf.data, false); if (!result6) + { + PQclear(result1); + PQclear(result2); + PQclear(result3); + PQclear(result4); + PQclear(result5); goto error_return; + } else inherits_count = PQntuples(result6); |