shadowsocksr-libev: fix build for gcc13

This commit is contained in:
sbwml 2024-01-12 07:28:48 +08:00
parent 27facaaffb
commit 3ec0dceb97

View File

@ -0,0 +1,16 @@
--- a/server/server.c
+++ b/server/server.c
@@ -1942,12 +1942,12 @@
text = (char*)malloc(strlen(protocol) - 11);
memcpy(text, protocol, strlen(protocol) - 11);
int length = strlen(protocol) - 11;
- free(protocol);
obfs = (char*)malloc(length);
memset(protocol, 0x00, length);
memcpy(protocol, text, length);
LOGI("protocol compatible enable, %s", protocol);
free(text);
+ free(protocol);
protocol_compatible = 1;
}
}