From: Christian Brauner Date: Fri, 26 Feb 2021 12:31:26 +0000 (+0100) Subject: confile_utils: ensure memory is zeroed X-Git-Tag: lxc-5.0.0~265^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9dffc40e2a400a208fff7af5dc3151dc1b2c3ca6;p=thirdparty%2Flxc.git confile_utils: ensure memory is zeroed Signed-off-by: Christian Brauner --- diff --git a/src/lxc/confile_utils.c b/src/lxc/confile_utils.c index e9d0c611e..899b58341 100644 --- a/src/lxc/confile_utils.c +++ b/src/lxc/confile_utils.c @@ -165,7 +165,7 @@ struct lxc_netdev *lxc_network_add(struct lxc_list *networks, int idx, bool tail __do_free struct lxc_netdev *netdev = NULL; /* network does not exist */ - netdev = malloc(sizeof(*netdev)); + netdev = zalloc(sizeof(*netdev)); if (!netdev) return ret_set_errno(NULL, ENOMEM); @@ -177,7 +177,7 @@ struct lxc_netdev *lxc_network_add(struct lxc_list *networks, int idx, bool tail netdev->idx = idx; /* prepare new list */ - newlist = malloc(sizeof(*newlist)); + newlist = zalloc(sizeof(*newlist)); if (!newlist) return ret_set_errno(NULL, ENOMEM);