From 321c0cc3493998f731f0666127c093eff4e119eb Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 17 Sep 2018 09:48:33 +0200 Subject: Fix localized error messages and memory leaks The FormatMessage API needs to LocalFree the delivered error messages. In cases where messages are delivered in non ASCII compatible encoding, the messages might be unreadable. This aligns the error message encoding with the encoding settings in PHP, the focus is UTF-8 as default. Initialize error buffer Avoid code duplication --- sapi/phpdbg/phpdbg_prompt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sapi/phpdbg/phpdbg_prompt.c') diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index 8815b90be2..f4b5a11fef 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -1311,7 +1311,7 @@ PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name) char *err = GET_DL_ERROR(); if (err && err[0]) { phpdbg_error("dl", "type=\"unknown\"", "%s", err); - LocalFree(err); + php_win32_error_msg_free(err); } else { phpdbg_error("dl", "type=\"unknown\"", "Unknown reason"); } -- cgit v1.2.1