git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eff9335)
Avoid palloc before CurrentMemoryContext is set up on win32
Fri, 1 Apr 2011 17:58:36 +0000 (19:58 +0200)
Fri, 1 Apr 2011 18:00:34 +0000 (20:00 +0200)
Instead, write the unconverted output - it will be in the wrong
encoding, but at least we don't crash.

Rushabh Lathia


diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index feb0bd51fc9f643475bc1aab31bde7674d6448eb..71aed1e0f1dea480c87e52aa0554c1b74713f62f 100644 (file)
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -1658,10 +1658,14 @@ write_console(const char *line, int len)
/*
* WriteConsoleW() will fail of stdout is redirected, so just fall through
* to writing unconverted to the logfile in this case.
+ *
+ * Since we palloc the structure required for conversion, also fall through
+ * to writing unconverted if we have not yet set up CurrentMemoryContext.
*/
if (GetDatabaseEncoding() != GetPlatformEncoding() &&
!in_error_recursion_trouble() &&
- !redirection_done)
+ !redirection_done &&
+ CurrentMemoryContext != NULL)
{
WCHAR *utf16;
int utf16len;
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /