From 64dd359192b6e7b6399db5ee4bf9647cb7b80476 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 5 Sep 2016 15:03:37 +0800 Subject: [PATCH] windows: WCHAR in lws_plat_inet_ntop needs double the final allocation https://github.com/warmcat/libwebsockets/issues/619 --- lib/lws-plat-win.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lws-plat-win.c b/lib/lws-plat-win.c index cdf37e98..a7e285ef 100644 --- a/lib/lws-plat-win.c +++ b/lib/lws-plat-win.c @@ -468,7 +468,7 @@ lws_plat_inet_ntop(int af, const void *src, char *dst, int cnt) DWORD bufferlen = cnt; BOOL ok = FALSE; - buffer = lws_malloc(bufferlen); + buffer = lws_malloc(bufferlen * 2); if (!buffer) { lwsl_err("Out of memory\n"); return NULL;