In ecpglib restore LC_NUMERIC in case of an error.
authorMichael Meskes <[email protected]>
Thu, 1 Sep 2011 13:27:38 +0000 (15:27 +0200)
committerMichael Meskes <[email protected]>
Thu, 1 Sep 2011 13:36:34 +0000 (15:36 +0200)
src/interfaces/ecpg/ecpglib/execute.c

index 51c5cdf8d801db9cc10fe100051127056e718cb5..0c4e0cc730c3dd2ac4910e07bb9c0f46902e8ad5 100644 (file)
@@ -1492,7 +1492,11 @@ 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, questionmarks, &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