aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2018-03-12 23:52:08 +0100
committerMichael Meskes <meskes@postgresql.org>2018-03-13 16:22:28 +0100
commitb32fad52e94307261471d05a79c70f8382d71657 (patch)
tree87c5e5a66fd76c5ebb3cbfd23060f845bbf0377e
parent17bb62501787c56e0518e61db13a523d47afd724 (diff)
downloadpostgresql-b32fad52e94307261471d05a79c70f8382d71657.tar.gz
postgresql-b32fad52e94307261471d05a79c70f8382d71657.zip
Set connection back to NULL after freeing it.
Patch by Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>
-rw-r--r--src/interfaces/ecpg/preproc/output.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/interfaces/ecpg/preproc/output.c b/src/interfaces/ecpg/preproc/output.c
index a55bf2b06a7..0465857eb6e 100644
--- a/src/interfaces/ecpg/preproc/output.c
+++ b/src/interfaces/ecpg/preproc/output.c
@@ -158,6 +158,7 @@ output_statement(char *stmt, int whenever_mode, enum ECPG_statement_type st)
free(stmt);
if (connection != NULL)
free(connection);
+ connection = NULL;
}
void
@@ -172,6 +173,7 @@ output_prepare_statement(char *name, char *stmt)
free(name);
if (connection != NULL)
free(connection);
+ connection = NULL;
}
void
@@ -192,6 +194,7 @@ output_deallocate_prepare_statement(char *name)
free(name);
if (connection != NULL)
free(connection);
+ connection = NULL;
}
static void