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_0_23~96 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=abf92840a113207ff78c17514c1d141850300586;p=thirdparty%2Fpostgresql.git 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 b28ae8239be..f008bbd4fe4 100644 --- a/src/interfaces/ecpg/ecpglib/connect.c +++ b/src/interfaces/ecpg/ecpglib/connect.c @@ -322,7 +322,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) {