summaryrefslogtreecommitdiffstats
path: root/src/network/netdev/netdev.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-11-12 07:32:26 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-11-12 08:32:11 +0100
commitc6dbb5c43f9fa22bb1ee6d5708b229f1946f32b2 (patch)
tree44bcafe214ddb6ce00174e225b80a9b324b35e74 /src/network/netdev/netdev.c
parentnetwork: allocate hashmap objects when they are required (diff)
downloadsystemd-c6dbb5c43f9fa22bb1ee6d5708b229f1946f32b2.tar.xz
systemd-c6dbb5c43f9fa22bb1ee6d5708b229f1946f32b2.zip
network: use hashmap_clear_with_destructor() at one more place
Diffstat (limited to 'src/network/netdev/netdev.c')
-rw-r--r--src/network/netdev/netdev.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/network/netdev/netdev.c b/src/network/netdev/netdev.c
index 33931bad92..53149636ea 100644
--- a/src/network/netdev/netdev.c
+++ b/src/network/netdev/netdev.c
@@ -798,14 +798,12 @@ int netdev_load_one(Manager *manager, const char *filename) {
int netdev_load(Manager *manager) {
_cleanup_strv_free_ char **files = NULL;
- NetDev *netdev;
char **f;
int r;
assert(manager);
- while ((netdev = hashmap_first(manager->netdevs)))
- netdev_unref(netdev);
+ hashmap_clear_with_destructor(manager->netdevs, netdev_unref);
r = conf_files_list_strv(&files, ".netdev", NULL, 0, network_dirs);
if (r < 0)