diff --git a/src/win/util.c b/src/win/util.c index 8df9362c8..0a7217cfb 100644 --- a/src/win/util.c +++ b/src/win/util.c @@ -534,14 +534,14 @@ int uv_uptime(double* uptime) { return uv_translate_sys_error(result); } - uv__free(malloced_buffer); - buffer_size *= 2; /* Don't let the buffer grow infinitely. */ if (buffer_size > 1 << 20) { goto internalError; } + uv__free(malloced_buffer); + buffer = malloced_buffer = (BYTE*) uv__malloc(buffer_size); if (malloced_buffer == NULL) { *uptime = 0;