Skip to content

Commit

Permalink
win: fix of double free in uv_uptime
Browse files Browse the repository at this point in the history
PR-URL: libuv#324
Reviewed-By: Saúl Ibarra Corretgé <[email protected]>
  • Loading branch information
pni-qlik authored and saghul committed Apr 21, 2015
1 parent 7dcc3e0 commit 21bcace
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/win/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 21bcace

Please sign in to comment.