From: Michael Meskes Date: Thu, 1 Sep 2011 13:27:38 +0000 (+0200) Subject: In ecpglib restore LC_NUMERIC in case of an error. X-Git-Tag: REL9_0_5~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f8c74422010e63506fa69635ea61920bc042b70e;p=thirdparty%2Fpostgresql.git In ecpglib restore LC_NUMERIC in case of an error. --- diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c index 1019bfe6201..589c57dffa8 100644 --- a/src/interfaces/ecpg/ecpglib/execute.c +++ b/src/interfaces/ecpg/ecpglib/execute.c @@ -1773,8 +1773,12 @@ ECPGdo(const int lineno, const int compat, const int force_indicator, const char */ if (statement_type == ECPGst_prepnormal) { - if (!ecpg_auto_prepare(lineno, connection_name, compat, &prepname, query)) + if (!ecpg_auto_prepare(lineno, connection_name, compat, &prepname, query)) { + setlocale(LC_NUMERIC, oldlocale); + ecpg_free(oldlocale); + va_end(args); return (false); + } /* * statement is now prepared, so instead of the query we have to @@ -1801,6 +1805,9 @@ ECPGdo(const int lineno, const int compat, const int force_indicator, const char else { ecpg_raise(lineno, ECPG_INVALID_STMT, ECPG_SQLSTATE_INVALID_SQL_STATEMENT_NAME, stmt->command); + setlocale(LC_NUMERIC, oldlocale); + ecpg_free(oldlocale); + va_end(args); return (false); } }