summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2015-06-15 14:20:09 +0200
committerMichael Meskes <meskes@postgresql.org>2015-06-15 14:22:50 +0200
commit3e2a17eecc4ceb76ac40978a15b26e120dbd52a6 (patch)
treedf510331c5e9f7cfd730a0909ced907963b510f0 /src
parent31c06d4b66627527fa1cc63a1f1e240848b5c7d8 (diff)
Fix memory leak in ecpglib's connect function.
Patch by Michael Paquier
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/ecpg/ecpglib/connect.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c
index 55c56807b2f..e45d17fcc57 100644
--- a/src/interfaces/ecpg/ecpglib/connect.c
+++ b/src/interfaces/ecpg/ecpglib/connect.c
@@ -321,7 +321,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)
{