diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog
index 33651faea4afb2f0943e363b33951dbdd89a8bd4..2b33f1f487d421d6b22afb8290d0652cdea12307 100644
--- a/src/interfaces/ecpg/ChangeLog
+++ b/src/interfaces/ecpg/ChangeLog
@@ -1554,6 +1554,10 @@ Fri Jul  4 13:51:11 CEST 2003
 Mon Jul  7 14:13:43 CEST 2003
 
 	- Made sure "char *" is handled differently than "char []".
+	
+Tue Jul  8 09:04:31 CEST 2003
+
+	- Fixed segfault in ECPGconnect in Informix mode.
 	- Set ecpg version to 3.0.0
 	- Set ecpg library to 4.0.0
 	- Set pgtypes library to 1.0.0
diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c
index d7c721acd339fe266675537d66dc347a24981d5a..433a5e2960210f16b3f076a6afa469568d64b794 100644
--- a/src/interfaces/ecpg/ecpglib/connect.c
+++ b/src/interfaces/ecpg/ecpglib/connect.c
@@ -1,4 +1,4 @@
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.10 2003/07/01 12:40:51 meskes Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.11 2003/07/08 07:13:48 meskes Exp $ */
 
 #define POSTGRES_ECPG_INTERNAL
 #include "postgres_fe.h"
@@ -324,8 +324,8 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
 		envname = getenv("PG_DBPATH");
 		if (envname)
 		{
-			free(dbname);
-			dbname = envname;
+			ECPGfree(dbname);
+			dbname = strdup(envname);
 		}
 					
 	}