diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2015-07-30 13:22:15 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@googlemail.com> | 2015-07-30 13:22:15 +0200 |
commit | 9e248507182e8e89891d45d1e27d0830e1def279 (patch) | |
tree | c662c5bf209dae93822ac07a831882a7ba4ba0b2 /src/network | |
parent | 5f17089ac1e86c25806d3f066243561360efd2ca (diff) | |
parent | 2fc09a9cdd1ad25bc7c53a23d5301eb952e1ce3d (diff) |
Merge pull request #785 from zonque/free-and-strdup
tree-wide: use free_and_strdup()
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkd-link.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 9d570e0146..78e96c4e5b 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -2059,10 +2059,9 @@ int link_update(Link *link, sd_netlink_message *m) { link_free_carrier_maps(link); - free(link->ifname); - link->ifname = strdup(ifname); - if (!link->ifname) - return -ENOMEM; + r = free_and_strdup(&link->ifname, ifname); + if (r < 0) + return r; r = link_new_carrier_maps(link); if (r < 0) |