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:23:25 +0100
commitfe65f5931942e6aa7ff0f185cd777eb8d635e3ae (patch)
tree79285adb2e13503d347a9967b4850513cfdd1819
parentc32f44c4a5b27f5055600db1a7374a898f3681df (diff)
downloadpostgresql-fe65f5931942e6aa7ff0f185cd777eb8d635e3ae.tar.gz
postgresql-fe65f5931942e6aa7ff0f185cd777eb8d635e3ae.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 0479c93c991..ee00d367caa 100644
--- a/src/interfaces/ecpg/preproc/output.c
+++ b/src/interfaces/ecpg/preproc/output.c
@@ -155,6 +155,7 @@ output_statement(char *stmt, int whenever_mode, enum ECPG_statement_type st)
free(stmt);
if (connection != NULL)
free(connection);
+ connection = NULL;
}
void
@@ -169,6 +170,7 @@ output_prepare_statement(char *name, char *stmt)
free(name);
if (connection != NULL)
free(connection);
+ connection = NULL;
}
void
@@ -189,6 +191,7 @@ output_deallocate_prepare_statement(char *name)
free(name);
if (connection != NULL)
free(connection);
+ connection = NULL;
}
static void