]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile_utils: cleanup lxc_free_networks()
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 9 Dec 2020 08:51:08 +0000 (09:51 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 10 Dec 2020 19:39:50 +0000 (20:39 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile_utils.c

index 97370e549675516dc3584e1a07f8331e24f34639..180dc88f11f2c06ce3531c6b9ee84c0b9c65c04a 100644 (file)
@@ -475,9 +475,9 @@ bool lxc_remove_nic_by_idx(struct lxc_conf *conf, unsigned int idx)
 void lxc_free_networks(struct lxc_list *networks)
 {
        struct lxc_list *cur, *next;
-       struct lxc_netdev *netdev;
 
-       lxc_list_for_each_safe(cur, networks, next) {
+       lxc_list_for_each_safe (cur, networks, next) {
+               struct lxc_netdev *netdev = cur->elem;
                netdev = cur->elem;
                lxc_free_netdev(netdev);
                free(cur);
@@ -487,7 +487,6 @@ void lxc_free_networks(struct lxc_list *networks)
        lxc_list_init(networks);
 }
 
-
 static struct lxc_veth_mode {
        char *name;
        int mode;