Skip to content

Commit b32fad5

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

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/interfaces/ecpg/preproc/output.c

+3
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ output_statement(char *stmt, int whenever_mode, enum ECPG_statement_type st)
158158
free(stmt);
159159
if (connection != NULL)
160160
free(connection);
161+
connection = NULL;
161162
}
162163

163164
void
@@ -172,6 +173,7 @@ output_prepare_statement(char *name, char *stmt)
172173
free(name);
173174
if (connection != NULL)
174175
free(connection);
176+
connection = NULL;
175177
}
176178

177179
void
@@ -192,6 +194,7 @@ output_deallocate_prepare_statement(char *name)
192194
free(name);
193195
if (connection != NULL)
194196
free(connection);
197+
connection = NULL;
195198
}
196199

197200
static void

0 commit comments

Comments
 (0)