summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-08-11 02:11:20 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-08-11 02:11:25 +0200
commit3dc2e7af5fc9d045416f8f6dc3f76799af7eb204 (patch)
treeafb556a29fb1f5c630414f3541d01c4c40ab78e1 /src
parentnetwork: fix potential memleaks related to set_put() (diff)
downloadsystemd-3dc2e7af5fc9d045416f8f6dc3f76799af7eb204.tar.xz
systemd-3dc2e7af5fc9d045416f8f6dc3f76799af7eb204.zip
network: add missing link_ref()
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-link.c4
-rw-r--r--src/network/networkd-manager.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 6bcb078808..a813fca565 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -2688,6 +2688,8 @@ int get_product_uuid_handler(sd_bus_message *m, void *userdata, sd_bus_error *re
configure:
while ((link = set_steal_first(manager->links_requesting_uuid))) {
+ link_unref(link);
+
r = link_configure(link);
if (r < 0)
link_enter_failed(link);
@@ -2760,6 +2762,8 @@ static int link_configure_duid(Link *link) {
r = set_put(m->duids_requesting_uuid, duid);
if (r < 0)
return log_oom();
+
+ link_ref(link);
}
return 0;
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index 74266ff12a..fe7c388826 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -1818,6 +1818,8 @@ int manager_request_product_uuid(Manager *m, Link *link) {
r = set_put(m->duids_requesting_uuid, duid);
if (r < 0)
return log_oom();
+
+ link_ref(link);
}
if (!m->bus || sd_bus_is_ready(m->bus) <= 0) {