1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

ecpg: Fix rare memory leaks

found by Coverity
This commit is contained in:
Peter Eisentraut
2012-03-08 22:21:12 +02:00
parent d93f209f48
commit 8dd4d10d48
2 changed files with 6 additions and 0 deletions

View File

@ -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;
} }

View File

@ -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
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);
} }