2
0
mirror of git://github.com/lxc/lxc synced 2025-08-31 18:05:48 +00:00

Merge pull request #1792 from Blub/cleanups

cleanup: remove unnecessary zeroing
This commit is contained in:
Christian Brauner
2017-09-06 12:17:21 +02:00
committed by GitHub
2 changed files with 0 additions and 19 deletions

View File

@@ -170,16 +170,6 @@ int set_config_network_legacy_type(const char *key, const char *value,
lxc_list_init(&netdev->ipv4);
lxc_list_init(&netdev->ipv6);
netdev->name[0] = '\0';
netdev->link[0] = '\0';
memset(&netdev->priv, 0, sizeof(netdev->priv));
/* I'm not completely sure if the memset takes care to zero the arrays
* in the union as well. So let's make extra sure and set the first byte
* to zero so that we don't have any surprises.
*/
netdev->priv.veth_attr.pair[0] = '\0';
netdev->priv.veth_attr.veth1[0] = '\0';
list = malloc(sizeof(*list));
if (!list) {
SYSERROR("failed to allocate memory");

View File

@@ -183,15 +183,6 @@ struct lxc_netdev *lxc_network_add(struct lxc_list *networks, int idx, bool tail
memset(netdev, 0, sizeof(*netdev));
lxc_list_init(&netdev->ipv4);
lxc_list_init(&netdev->ipv6);
netdev->name[0] = '\0';
netdev->link[0] = '\0';
memset(&netdev->priv, 0, sizeof(netdev->priv));
/* I'm not completely sure if the memset takes care to zero the arrays
* in the union as well. So let's make extra sure and set the first byte
* to zero so that we don't have any surprises.
*/
netdev->priv.veth_attr.pair[0] = '\0';
netdev->priv.veth_attr.veth1[0] = '\0';
/* give network a unique index */
netdev->idx = idx;