Skip to content

Commit 6c7c5c6

Browse files
committed
fix: memory alias within a for loop
1 parent 7d0982b commit 6c7c5c6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

controllers/azuremachine_reconciler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ func (s *azureMachineService) createVirtualMachine(nicName string) (*infrav1.VM,
346346
func GetControlPlaneMachines(machineList *clusterv1.MachineList) []*clusterv1.Machine {
347347
var cpm []*clusterv1.Machine
348348
for _, m := range machineList.Items {
349+
m := m
349350
if util.IsControlPlaneMachine(&m) {
350351
cpm = append(cpm, m.DeepCopy())
351352
}

0 commit comments

Comments
 (0)