mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 01:18:00 +03:00
qemuDomainUnshareNamespace: Use automatic memory clearing for string lists
'devMountsPath' and 'devMountsSavePath' are NULL terminated. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
1b3c391a55
commit
65b918432e
@ -682,7 +682,8 @@ qemuDomainUnshareNamespace(virQEMUDriverConfig *cfg,
|
||||
virDomainObj *vm)
|
||||
{
|
||||
const char *devPath = NULL;
|
||||
char **devMountsPath = NULL, **devMountsSavePath = NULL;
|
||||
g_auto(GStrv) devMountsPath = NULL;
|
||||
g_auto(GStrv) devMountsSavePath = NULL;
|
||||
size_t ndevMountsPath = 0, i;
|
||||
int ret = -1;
|
||||
|
||||
@ -791,8 +792,6 @@ qemuDomainUnshareNamespace(virQEMUDriverConfig *cfg,
|
||||
else
|
||||
unlink(devMountsSavePath[i]);
|
||||
}
|
||||
virStringListFreeCount(devMountsPath, ndevMountsPath);
|
||||
virStringListFreeCount(devMountsSavePath, ndevMountsPath);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user