mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-05 04:41:20 +00:00
virLXCProcessSetupNamespaceName: Fix potential uninitialized free of 'path'
'path' could be accessed uninitialized. Fix it by using g_autofree which also mandates initialization. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
78ead2529b
commit
140c756f5c
@ -409,7 +409,7 @@ static int virLXCProcessSetupNamespaceName(virLXCDriverPtr driver,
|
||||
int fd = -1;
|
||||
virDomainObjPtr vm;
|
||||
virLXCDomainObjPrivatePtr priv;
|
||||
char *path;
|
||||
g_autofree char *path = NULL;
|
||||
|
||||
vm = virDomainObjListFindByName(driver->domains, name);
|
||||
if (!vm) {
|
||||
@ -436,7 +436,6 @@ static int virLXCProcessSetupNamespaceName(virLXCDriverPtr driver,
|
||||
}
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(path);
|
||||
virDomainObjEndAPI(&vm);
|
||||
return fd;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user