Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 44a36a8

Browse files
author
Michael Meskes
committed
Set connection back to NULL after freeing it.
Patch by Jeevan Ladhe <[email protected]>
1 parent 976e584 commit 44a36a8

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)