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.
This commit is contained in:
Willy Tarreau 2025-04-12 18:22:34 +02:00
parent 39c05cedff
commit 4a44d592ae

View File

@ -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