Skip to content

Commit 0c96e42

Browse files
author
Michael Meskes
committed
Applied patch by Peter Harris to free auto_mem structure on connect
1 parent 415b925 commit 0c96e42

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2149,5 +2149,9 @@ Th 14. Sep 09:47:03 CEST 2006
21492149

21502150
- Completely removed complex tests.
21512151
- Added missing constuctor/destructor for interval and date.
2152+
2153+
We 8. Nov 10:53:42 CET 2006
2154+
2155+
- Applied patch by Peter Harris to free auto_mem struct in ECPGconnect.
21522156
- Set ecpg library version to 5.2.
21532157
- Set ecpg version to 4.2.1.

src/interfaces/ecpg/ecpglib/connect.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.36 2006/10/04 00:30:11 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.37 2006/11/08 10:46:47 meskes Exp $ */
22

33
#define POSTGRES_ECPG_INTERNAL
44
#include "postgres_fe.h"
@@ -277,6 +277,9 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
277277

278278
ECPGinit_sqlca(sqlca);
279279

280+
/* clear auto_mem structure because some error handling functions might access it */
281+
ECPGclear_auto_mem();
282+
280283
if (INFORMIX_MODE(compat))
281284
{
282285
char *envname;

src/interfaces/ecpg/ecpglib/memory.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/memory.c,v 1.7 2005/10/15 02:49:47 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/memory.c,v 1.8 2006/11/08 10:46:47 meskes Exp $ */
22

33
#define POSTGRES_ECPG_INTERNAL
44
#include "postgres_fe.h"
@@ -101,7 +101,7 @@ ECPGclear_auto_mem(void)
101101
{
102102
struct auto_mem *am;
103103

104-
/* free just our own structure */
104+
/* only free our own structure */
105105
for (am = auto_allocs; am;)
106106
{
107107
struct auto_mem *act = am;

0 commit comments

Comments
 (0)