From 3aabd1ec491217e96c404d3efc74f34f37808a9c Mon Sep 17 00:00:00 2001 From: Eladash <18193363+elad335@users.noreply.github.com> Date: Wed, 3 Apr 2024 14:22:34 +0300 Subject: [PATCH] hid.c: Fix reinitialization after an error --- linux/hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/hid.c b/linux/hid.c index 2d079183..629f66ba 100644 --- a/linux/hid.c +++ b/linux/hid.c @@ -136,7 +136,7 @@ static void register_error_str(wchar_t **error_str, const char *msg) /* Semilar to register_error_str, but allows passing a format string with va_list args into this function. */ static void register_error_str_vformat(wchar_t **error_str, const char *format, va_list args) { - char msg[256]; + char* msg = (char*)malloc(256); vsnprintf(msg, sizeof(msg), format, args); register_error_str(error_str, msg);