Index: src/bin/pg_dump/pg_dump.c =================================================================== RCS file: /home/alvherre/cvs/pgsql/src/bin/pg_dump/pg_dump.c,v retrieving revision 1.434 diff -c -r1.434 pg_dump.c *** src/bin/pg_dump/pg_dump.c 26 May 2006 23:48:54 -0000 1.434 --- src/bin/pg_dump/pg_dump.c 28 May 2006 15:39:14 -0000 *************** *** 1445,1452 **** check_sql_result(res, g_conn, qry->data, PGRES_TUPLES_OK); - PQclear(res); - resetPQExpBuffer(qry); std_strings = (strcmp(PQgetvalue(res, 0, 0), "on") == 0); --- 1445,1450 ---- *************** *** 1454,1460 **** appendStringLiteral(qry, PQgetvalue(res, 0, 0), true, !std_strings); appendPQExpBuffer(qry, ";\n"); puts(PQgetvalue(res, 0, 0)); ! } ArchiveEntry(AH, nilCatalogId, createDumpId(), --- 1452,1459 ---- appendStringLiteral(qry, PQgetvalue(res, 0, 0), true, !std_strings); appendPQExpBuffer(qry, ";\n"); puts(PQgetvalue(res, 0, 0)); ! ! PQclear(res); } ArchiveEntry(AH, nilCatalogId, createDumpId(), Index: src/interfaces/libpq/fe-exec.c =================================================================== RCS file: /home/alvherre/cvs/pgsql/src/interfaces/libpq/fe-exec.c,v retrieving revision 1.184 diff -c -r1.184 fe-exec.c *** src/interfaces/libpq/fe-exec.c 23 May 2006 22:13:19 -0000 1.184 --- src/interfaces/libpq/fe-exec.c 28 May 2006 15:39:20 -0000 *************** *** 358,368 **** --- 358,372 ---- { res->curBlock = block->next; free(block); + block = NULL; } /* Free the top-level tuple pointer array */ if (res->tuples) + { free(res->tuples); + res->tuples = NULL; + } /* Free the PGresult structure itself */ free(res);