Skip to content

Commit abf9284

Browse files
author
Michael Meskes
committed
Fix memory leak in ecpglib's connect function.
Patch by Michael Paquier
1 parent 235bd4c commit abf9284

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/interfaces/ecpg/ecpglib/connect.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,10 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
322322
}
323323

324324
if ((this = (struct connection *) ecpg_alloc(sizeof(struct connection), lineno)) == NULL)
325+
{
326+
ecpg_free(dbname);
325327
return false;
328+
}
326329

327330
if (dbname != NULL)
328331
{

0 commit comments

Comments
 (0)