Commit 8dd4d10d authored by Peter Eisentraut's avatar Peter Eisentraut

ecpg: Fix rare memory leaks

found by Coverity
parent d93f209f
...@@ -519,6 +519,10 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p ...@@ -519,6 +519,10 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
ecpg_free(realname); ecpg_free(realname);
if (dbname) if (dbname)
ecpg_free(dbname); ecpg_free(dbname);
if (conn_keywords)
ecpg_free(conn_keywords);
if (conn_values)
ecpg_free(conn_values);
free(this); free(this);
return false; return false;
} }
......
...@@ -1776,6 +1776,7 @@ ECPGdo(const int lineno, const int compat, const int force_indicator, const char ...@@ -1776,6 +1776,7 @@ ECPGdo(const int lineno, const int compat, const int force_indicator, const char
{ {
setlocale(LC_NUMERIC, oldlocale); setlocale(LC_NUMERIC, oldlocale);
ecpg_free(oldlocale); ecpg_free(oldlocale);
free_statement(stmt);
va_end(args); va_end(args);
return (false); return (false);
} }
...@@ -1807,6 +1808,7 @@ ECPGdo(const int lineno, const int compat, const int force_indicator, const char ...@@ -1807,6 +1808,7 @@ ECPGdo(const int lineno, const int compat, const int force_indicator, const char
ecpg_raise(lineno, ECPG_INVALID_STMT, ECPG_SQLSTATE_INVALID_SQL_STATEMENT_NAME, stmt->command); ecpg_raise(lineno, ECPG_INVALID_STMT, ECPG_SQLSTATE_INVALID_SQL_STATEMENT_NAME, stmt->command);
setlocale(LC_NUMERIC, oldlocale); setlocale(LC_NUMERIC, oldlocale);
ecpg_free(oldlocale); ecpg_free(oldlocale);
free_statement(stmt);
va_end(args); va_end(args);
return (false); return (false);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment