From: Michael Meskes Date: Mon, 15 Jun 2015 12:20:09 +0000 (+0200) Subject: Fix memory leak in ecpglib's connect function. X-Git-Tag: REL9_5_ALPHA1~60 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=af0b49fc98cb3494d1e444a4f5c3364627a3ed5f;p=postgresql Fix memory leak in ecpglib's connect function. Patch by Michael Paquier --- diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c index 55c56807b2..e45d17fcc5 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) {