Skip to content

Commit

Permalink
Fix double free in platform/sys.c
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaiepi committed Dec 5, 2018
1 parent c0799ec commit 6455d1f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/platform/sys.c
Expand Up @@ -4,9 +4,10 @@
MVMuint32 MVM_platform_cpu_count(void) {
int count;
uv_cpu_info_t *info;
int e;

uv_cpu_info(&info, &count);
uv_free_cpu_info(info, count);
e = uv_cpu_info(&info, &count);
if (e == 0) uv_free_cpu_info(info, count);

return count;
}

0 comments on commit 6455d1f

Please sign in to comment.