From 44a36a8d9a6e7ba209253d694dd2ebf3e13f0b5d Mon Sep 17 00:00:00 2001 From: Michael Meskes Date: Mon, 12 Mar 2018 23:52:08 +0100 Subject: [PATCH] Set connection back to NULL after freeing it. Patch by Jeevan Ladhe --- 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 59d5d30df4a..93a1ad1498d 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