Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8dd4d10

Browse files
committed
ecpg: Fix rare memory leaks
found by Coverity
1 parent d93f209 commit 8dd4d10

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/interfaces/ecpg/ecpglib/connect.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,10 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
519519
ecpg_free(realname);
520520
if (dbname)
521521
ecpg_free(dbname);
522+
if (conn_keywords)
523+
ecpg_free(conn_keywords);
524+
if (conn_values)
525+
ecpg_free(conn_values);
522526
free(this);
523527
return false;
524528
}

src/interfaces/ecpg/ecpglib/execute.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,6 +1776,7 @@ ECPGdo(const int lineno, const int compat, const int force_indicator, const char
17761776
{
17771777
setlocale(LC_NUMERIC, oldlocale);
17781778
ecpg_free(oldlocale);
1779+
free_statement(stmt);
17791780
va_end(args);
17801781
return (false);
17811782
}
@@ -1807,6 +1808,7 @@ ECPGdo(const int lineno, const int compat, const int force_indicator, const char
18071808
ecpg_raise(lineno, ECPG_INVALID_STMT, ECPG_SQLSTATE_INVALID_SQL_STATEMENT_NAME, stmt->command);
18081809
setlocale(LC_NUMERIC, oldlocale);
18091810
ecpg_free(oldlocale);
1811+
free_statement(stmt);
18101812
va_end(args);
18111813
return (false);
18121814
}

0 commit comments

Comments
 (0)