]> granicus.if.org Git - postgresql/commitdiff
Set connection back to NULL after freeing it.
authorMichael Meskes <meskes@postgresql.org>
Mon, 12 Mar 2018 22:52:08 +0000 (23:52 +0100)
committerMichael Meskes <meskes@postgresql.org>
Tue, 13 Mar 2018 15:23:25 +0000 (16:23 +0100)
Patch by Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>

src/interfaces/ecpg/preproc/output.c

index 0479c93c99149baceb6bb5cd6e08f3de9408def4..ee00d367caa5669966884bcd56b107009fb42040 100644 (file)
@@ -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