From 4a44d592ae102162f5d989630860001357de750a Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 12 Apr 2025 18:22:34 +0200 Subject: [PATCH] BUG/MINOR: cpu-topo: check the correct variable for NULL after malloc() We were testing ha_cpu_topo instead of ha_cpu_clusters after an allocation, making the check ineffective. No backport is needed. --- src/cpu_topo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpu_topo.c b/src/cpu_topo.c index 0416d69db..2e64f21ea 100644 --- a/src/cpu_topo.c +++ b/src/cpu_topo.c @@ -1822,7 +1822,7 @@ static int cpu_topo_alloc(void) /* allocate the structures used to store CPU topology info */ ha_cpu_clusters = (struct ha_cpu_cluster*)malloc(cpu_topo_maxcpus * sizeof(*ha_cpu_clusters)); - if (!ha_cpu_topo) + if (!ha_cpu_clusters) return 0; /* preset all fields to -1 except the index and the state flags which -- 2.47.2