]> git.proxmox.com Git - mirror_lxc.git/blobdiff - src/lxc/confile_utils.c
confile_utils: cleanup lxc_free_networks()
[mirror_lxc.git] / src / lxc / confile_utils.c
index 49c342fe0c232c730c1db62ffa360f89c306e6ec..c421f173d72be50b6c2fa6f337f0390a5048d369 100644 (file)
@@ -460,9 +460,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);
@@ -472,7 +472,6 @@ void lxc_free_networks(struct lxc_list *networks)
        lxc_list_init(networks);
 }
 
-
 static struct lxc_veth_mode {
        char *name;
        int mode;