On Thu, Jan 07, 2010 at 01:04:34PM -0200, Marcelo Mas (AT&G) wrote:
>   I have already a sample that I am sending to you.
> ...

The problem was already fixed in CVS HEAD by Zoltan, I just ported the patch
back to 8.4 and committed it. So it will be in the next 8.4 release. And of
course the patch is attached.

Thanks for reporting.

Michael

-- 
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ: 179140304, AIM/Yahoo/Skype: michaelmeskes, Jabber: mes...@jabber.org
VfL Borussia! Forca Barca! Go SF 49ers! Use: Debian GNU/Linux, PostgreSQL
diff --exclude CVS -ruN /home/michael/technik/sources/archive/postgresql/pgsql-ecpg-8.4/ecpglib/prepare.c ecpglib/prepare.c
--- /home/michael/technik/sources/archive/postgresql/pgsql-ecpg-8.4/ecpglib/prepare.c	2009-09-11 09:31:48.000000000 +0200
+++ ecpglib/prepare.c	2010-01-08 10:22:44.000000000 +0100
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/prepare.c,v 1.31.2.1 2009/07/22 11:07:04 mha Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/prepare.c,v 1.31.2.2 2010/01/08 09:22:44 meskes Exp $ */
 
 #define POSTGRES_ECPG_INTERNAL
 #include "postgres_fe.h"
@@ -152,7 +152,7 @@
 	replace_variables(&(stmt->command), lineno);
 
 	/* add prepared statement to our list */
-	this->name = (char *) name;
+	this->name = ecpg_strdup(name, lineno);
 	this->stmt = stmt;
 
 	/* and finally really prepare the statement */
@@ -160,6 +160,7 @@
 	if (!ecpg_check_PQresult(query, stmt->lineno, stmt->connection->connection, stmt->compat))
 	{
 		ecpg_free(stmt->command);
+		ecpg_free(this->name);
 		ecpg_free(this);
 		ecpg_free(stmt);
 		return false;
@@ -238,6 +239,7 @@
 	/* okay, free all the resources */
 	ecpg_free(this->stmt->command);
 	ecpg_free(this->stmt);
+	ecpg_free(this->name);
 	if (prev != NULL)
 		prev->next = this->next;
 	else
-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to