mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-10-16 21:30:52 +00:00
networkd: link - fix memory leak
Make link_initialized() idempotent to avoid taking refs on several udev_device objects.
This commit is contained in:
@@ -2122,6 +2122,9 @@ int link_initialized(Link *link, struct udev_device *device) {
|
||||
if (link->state != LINK_STATE_INITIALIZING)
|
||||
return 0;
|
||||
|
||||
if (link->udev_device)
|
||||
return 0;
|
||||
|
||||
log_debug_link(link, "udev initialized link");
|
||||
|
||||
link->udev_device = udev_device_ref(device);
|
||||
|
||||
Reference in New Issue
Block a user