From 2069b1ea85de4c93419278528aea0e62599819f9 Mon Sep 17 00:00:00 2001 From: kyoubate-haruka <46010460+kyoubate-haruka@users.noreply.github.com> Date: Thu, 14 Nov 2024 13:03:13 +0100 Subject: [PATCH] dns: fix msvc build --- hooklib/dns.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hooklib/dns.c b/hooklib/dns.c index c3b95fb..8884989 100644 --- a/hooklib/dns.c +++ b/hooklib/dns.c @@ -670,7 +670,7 @@ DWORD WINAPI hook_send(SOCKET s, const char* buf, int len, int flags) { char *host_value_end = strstr(host_value_start, "\r\n"); if (host_value_end != NULL) { int value_len = host_value_end - host_value_start; - char host_value[value_len + 1]; + char* host_value = (char*)malloc(value_len + 1); strncpy(host_value, host_value_start, value_len); host_value[value_len] = '\0'; @@ -685,6 +685,7 @@ DWORD WINAPI hook_send(SOCKET s, const char* buf, int len, int flags) { break; } } + free(host_value); } len = (int)strlen(new_buf); }