node_device_driver: use g_autofree instead of VIR_FREE()

Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Karim Taha 2024-03-17 17:19:21 +02:00 committed by Michal Privoznik
parent 771bfe0c0d
commit a7e258d7c9

View File

@ -439,7 +439,7 @@ nodeDeviceListCaps(virNodeDevicePtr device,
{
virNodeDeviceObj *obj;
virNodeDeviceDef *def;
virNodeDevCapType *list = NULL;
g_autofree virNodeDevCapType *list = NULL;
int ncaps = 0;
int ret = -1;
size_t i = 0;
@ -472,8 +472,6 @@ nodeDeviceListCaps(virNodeDevicePtr device,
for (j = 0; j < i; j++)
VIR_FREE(names[j]);
}
VIR_FREE(list);
return ret;
}