mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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;
|
int fd = -1;
|
||||||
virDomainObjPtr vm;
|
virDomainObjPtr vm;
|
||||||
virLXCDomainObjPrivatePtr priv;
|
virLXCDomainObjPrivatePtr priv;
|
||||||
char *path;
|
g_autofree char *path = NULL;
|
||||||
|
|
||||||
vm = virDomainObjListFindByName(driver->domains, name);
|
vm = virDomainObjListFindByName(driver->domains, name);
|
||||||
if (!vm) {
|
if (!vm) {
|
||||||
@ -436,7 +436,6 @@ static int virLXCProcessSetupNamespaceName(virLXCDriverPtr driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(path);
|
|
||||||
virDomainObjEndAPI(&vm);
|
virDomainObjEndAPI(&vm);
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user