postgres.git / summary / log / commit / refs
commit a38f08bb9de6064fe3f42d273bd60a96adceb4bd
Author: Michael Meskes <meskes@postgresql.org>
Date: Mon Jun 15 12:20:09 2015 +0000
First released in: 9.5.0, 9.0.23, 9.1.19, 9.2.14, 9.3.10, 9.4.5
Fix memory leak in ecpglib's connect function.
Patch by Michael Paquier
src/interfaces/ecpg/ecpglib/connect.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c
index 4f5541308e5..d255c5d8f88 100644
--- a/src/interfaces/ecpg/ecpglib/connect.c
+++ b/src/interfaces/ecpg/ecpglib/connect.c
@@ -320,7 +320,10 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
}
if ((this = (struct connection *) ecpg_alloc(sizeof(struct connection), lineno)) == NULL)
+ {
+ ecpg_free(dbname);
return false;
+ }
if (dbname != NULL)
{
[parent: a5238ced6789]