From d2a45ce364ed97e916be3bcecfd756f15d852473 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 11 Mar 2026 22:43:35 +0100 Subject: [PATCH] win: fix const correctness warning (#5057) And fix it by calling uv_free_cpu_info so we don't repeat repeat ourselves. --- src/win/util.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/win/util.c b/src/win/util.c index bd9f7a67c..436bf3055 100644 --- a/src/win/util.c +++ b/src/win/util.c @@ -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);