postgres.git / summary / log / commit / refs
commit bd7eb6fe65b34963135851f06210d8e5fe048ef4
Author: Michael Meskes <meskes@postgresql.org>
Date: Mon Mar 12 22:52:08 2018 +0000
First released in: 11.0, 9.3.23, 9.4.18, 9.5.13, 9.6.9, 10.4
Set connection back to NULL after freeing it.
Patch by Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>
src/interfaces/ecpg/preproc/output.c | 3 +++
1 file changed, 3 insertions(+)
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
[parent: e556fb137279]