summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Savage <cfis@savagexi.com>2023-04-20 00:31:25 -0700
committerCharlie Savage <cfis@savagexi.com>2023-04-20 00:31:25 -0700
commit03b8801d00463722e65ba9fd14992945f2c482cb (patch)
treeba99f3770be0c00474b6fd3d3fdd1757ffdee3cc
parenta17aeb88c98a51ddfaff1f85e91612a105c088c5 (diff)
downloadffi-03b8801d00463722e65ba9fd14992945f2c482cb.tar.gz
Free the message allocated by FormatMessageA (should have been in last commit).
-rw-r--r--ext/ffi_c/DynamicLibrary.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/ffi_c/DynamicLibrary.c b/ext/ffi_c/DynamicLibrary.c
index 6c27ec6..bcbc8de 100644
--- a/ext/ffi_c/DynamicLibrary.c
+++ b/ext/ffi_c/DynamicLibrary.c
@@ -235,6 +235,9 @@ dl_error(char* buf, int size)
// Update the passed in buffer
snprintf(buf, size, "Failed with error %d: %s", error, message);
+
+ // Free the allocated message
+ LocalFree(message);
}
#endif