Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fe65f59

Browse files
author
Michael Meskes
committed
Set connection back to NULL after freeing it.
Patch by Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>
1 parent c32f44c commit fe65f59

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/interfaces/ecpg/preproc/output.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ output_statement(char *stmt, int whenever_mode, enum ECPG_statement_type st)
155155
free(stmt);
156156
if (connection != NULL)
157157
free(connection);
158+
connection = NULL;
158159
}
159160

160161
void
@@ -169,6 +170,7 @@ output_prepare_statement(char *name, char *stmt)
169170
free(name);
170171
if (connection != NULL)
171172
free(connection);
173+
connection = NULL;
172174
}
173175

174176
void
@@ -189,6 +191,7 @@ output_deallocate_prepare_statement(char *name)
189191
free(name);
190192
if (connection != NULL)
191193
free(connection);
194+
connection = NULL;
192195
}
193196

194197
static void

0 commit comments

Comments
 (0)