Fix crash on Windows if loading a plugin fails.

Closes #1866. Thanks to roebotron.
This commit is contained in:
Roger A. Light
2020-10-27 18:25:00 +00:00
parent 451b8d0f59
commit e01d391c0b
2 changed files with 2 additions and 1 deletions

View File

@@ -62,6 +62,7 @@ Broker:
- Fix `log_timestamp_format` not applying to `log_dest topic`. Closes #1862.
- Add the `bridge_max_packet_size` option. Closes #265.
- Add the `bridge_bind_address` option. Closes #1311.
- Fix crash on Windows if loading a plugin fails. Closes #1866.
Client library:
- Client no longer generates random client ids for v3.1.1 clients, these are

View File

@@ -35,7 +35,7 @@ void LIB_ERROR(void)
{
#ifdef WIN32
char *buf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, GetLastError(), LANG_NEUTRAL, (LPTSTR)&buf, 0, NULL);
log__printf(NULL, MOSQ_LOG_ERR, "Load error: %s", buf);
LocalFree(buf);