mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
interface: fix udev reference leak with invalid flags
The udevInterfaceGetXMLDesc method takes a reference on the udev driver as its first action. If the virCheckFlags() condition fails, however, this reference is never released. Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
98f1cf88fa
commit
3499354e12
@ -1027,12 +1027,14 @@ static char *
|
||||
udevInterfaceGetXMLDesc(virInterfacePtr ifinfo,
|
||||
unsigned int flags)
|
||||
{
|
||||
struct udev *udev = udev_ref(driver->udev);
|
||||
struct udev *udev = NULL;
|
||||
g_autoptr(virInterfaceDef) ifacedef = NULL;
|
||||
char *xmlstr = NULL;
|
||||
|
||||
virCheckFlags(VIR_INTERFACE_XML_INACTIVE, NULL);
|
||||
|
||||
udev = udev_ref(driver->udev);
|
||||
|
||||
/* Recursively build up the interface XML based on the requested
|
||||
* interface name
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user