diff options
author | Michael Meskes <meskes@postgresql.org> | 2015-06-15 14:20:09 +0200 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2015-06-15 14:23:17 +0200 |
commit | a38f08bb9de6064fe3f42d273bd60a96adceb4bd (patch) | |
tree | 8c5764126446948e14034bee11bdcbc1fd41af7d /src | |
parent | a5238ced6789191c24d4979fdd06dd8d4412f72c (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.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) { |