mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-17 19:30:00 +08:00
ecpg: Fix rare memory leaks
found by Coverity
This commit is contained in:
parent
d93f209f48
commit
8dd4d10d48
@ -519,6 +519,10 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
|
||||
ecpg_free(realname);
|
||||
if (dbname)
|
||||
ecpg_free(dbname);
|
||||
if (conn_keywords)
|
||||
ecpg_free(conn_keywords);
|
||||
if (conn_values)
|
||||
ecpg_free(conn_values);
|
||||
free(this);
|
||||
return false;
|
||||
}
|
||||
|
@ -1776,6 +1776,7 @@ ECPGdo(const int lineno, const int compat, const int force_indicator, const char
|
||||
{
|
||||
setlocale(LC_NUMERIC, oldlocale);
|
||||
ecpg_free(oldlocale);
|
||||
free_statement(stmt);
|
||||
va_end(args);
|
||||
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);
|
||||
setlocale(LC_NUMERIC, oldlocale);
|
||||
ecpg_free(oldlocale);
|
||||
free_statement(stmt);
|
||||
va_end(args);
|
||||
return (false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user