nmcli/devices: fix a crash

This is not good:

  $ nmcli device delete nm-bond
  Segmentation fault (core dumped)

Fixes: 5f9d2927ed ("nmcli/devices: use GPtrArray from get_device_list() directly")
This commit is contained in:
Lubomir Rintel 2022-06-23 15:12:19 +02:00
parent 9f9c82f39b
commit 0e2ddfd071

View file

@ -2733,8 +2733,8 @@ do_devices_delete(const NMCCommand *cmd, NmCli *nmc, int argc, const char *const
nmc->nowait_flag = (nmc->timeout == 0);
nmc->should_wait++;
for (i = 0; i < queue->len; i++) {
nm_device_delete_async(queue->pdata[i], NULL, delete_device_cb, info);
for (i = 0; i < info->queue->len; i++) {
nm_device_delete_async(info->queue->pdata[i], NULL, delete_device_cb, info);
}
}