win: fix const correctness warning (#5057)

And fix it by calling uv_free_cpu_info so we don't repeat repeat
ourselves.
This commit is contained in:
Ben Noordhuis 2026-03-11 22:43:35 +01:00 committed by GitHub
parent 52891c8255
commit d2a45ce364
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -639,12 +639,8 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos_ptr, int* cpu_count_ptr) {
error:
if (cpu_infos != NULL) {
/* This is safe because the cpu_infos array is zeroed on allocation. */
for (i = 0; i < cpu_count; i++)
uv__free(cpu_infos[i].model);
uv_free_cpu_info(cpu_infos, cpu_count);
}
uv__free(cpu_infos);
uv__free(sppi);
return uv_translate_sys_error(err);