From: Michael Meskes Date: Mon, 12 Mar 2018 22:52:08 +0000 (+0100) Subject: Set connection back to NULL after freeing it. X-Git-Tag: REL_11_BETA1~614 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b32fad52e94307261471d05a79c70f8382d71657;p=postgresql Set connection back to NULL after freeing it. Patch by Jeevan Ladhe --- diff --git a/src/interfaces/ecpg/preproc/output.c b/src/interfaces/ecpg/preproc/output.c index a55bf2b06a..0465857eb6 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