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-12 23:53:46 +0100
commit95f0260218ba5882828c245710964c828da6fb26 (patch)
tree1ebd0216a85ef4ba2323d976d5ed3daa3d15a96e
parent106d588055a2773ac005125360c65dd0d26cd35e (diff)
downloadpostgresql-95f0260218ba5882828c245710964c828da6fb26.tar.gz
postgresql-95f0260218ba5882828c245710964c828da6fb26.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 7e59419442e..385d5fe910a 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