Commit 541f1855 authored by Marc G. Fournier's avatar Marc G. Fournier

From: Igor <igor@sba.miami.edu>

Subject: [PATCHES] patch for a memory leak

Well...I screwed up and posted the wrong patch for psql originally..
The patch for that patch wposted below will fix it..
parent e234687c
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.68 1997/06/01 15:53:24 scrappy Exp $ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.69 1997/06/02 03:04:50 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -583,11 +583,13 @@ SendQuery(bool * success_p, PsqlSettings * settings, const char *query, ...@@ -583,11 +583,13 @@ SendQuery(bool * success_p, PsqlSettings * settings, const char *query,
break; break;
case PGRES_EMPTY_QUERY: case PGRES_EMPTY_QUERY:
*success_p = true; *success_p = true;
PQclear(results);
break; break;
case PGRES_COMMAND_OK: case PGRES_COMMAND_OK:
*success_p = true; *success_p = true;
if (!settings->quiet) if (!settings->quiet)
fprintf(stdout, "%s\n", PQcmdStatus(results)); fprintf(stdout, "%s\n", PQcmdStatus(results));
PQclear(results);
break; break;
case PGRES_COPY_OUT: case PGRES_COPY_OUT:
*success_p = true; *success_p = true;
...@@ -599,6 +601,7 @@ SendQuery(bool * success_p, PsqlSettings * settings, const char *query, ...@@ -599,6 +601,7 @@ SendQuery(bool * success_p, PsqlSettings * settings, const char *query,
handleCopyOut(results, settings->quiet, stdout); handleCopyOut(results, settings->quiet, stdout);
} }
PQclear(results);
break; break;
case PGRES_COPY_IN: case PGRES_COPY_IN:
*success_p = true; *success_p = true;
...@@ -606,6 +609,7 @@ SendQuery(bool * success_p, PsqlSettings * settings, const char *query, ...@@ -606,6 +609,7 @@ SendQuery(bool * success_p, PsqlSettings * settings, const char *query,
handleCopyIn(results, false, copystream); handleCopyIn(results, false, copystream);
else else
handleCopyIn(results, !settings->quiet, stdin); handleCopyIn(results, !settings->quiet, stdin);
PQclear(results);
break; break;
case PGRES_NONFATAL_ERROR: case PGRES_NONFATAL_ERROR:
case PGRES_FATAL_ERROR: case PGRES_FATAL_ERROR:
...@@ -630,7 +634,6 @@ SendQuery(bool * success_p, PsqlSettings * settings, const char *query, ...@@ -630,7 +634,6 @@ SendQuery(bool * success_p, PsqlSettings * settings, const char *query,
notify->relname, notify->be_pid); notify->relname, notify->be_pid);
free(notify); free(notify);
} }
PQclear(results);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment