]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile_utils: don't free netdev twice 3724/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 25 Mar 2021 07:23:25 +0000 (08:23 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 25 Mar 2021 07:23:25 +0000 (08:23 +0100)
lxc_free_netdev() will already free the list element.

Fixes: https://github.com/google/oss-fuzz/pull/5498
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile_utils.c

index 899b58341e5d225a9943943eabd8bacfb4b28bde..78f82267ea4ddac92aef59c0fcab406e023e5df7 100644 (file)
@@ -465,7 +465,6 @@ bool lxc_remove_nic_by_idx(struct lxc_conf *conf, unsigned int idx)
                        continue;
 
                lxc_list_del(cur);
-               free(cur);
                return true;
        }
 
@@ -480,7 +479,6 @@ void lxc_free_networks(struct lxc_list *networks)
                struct lxc_netdev *netdev = cur->elem;
                netdev = cur->elem;
                lxc_free_netdev(netdev);
-               free(cur);
        }
 
        /* prevent segfaults */