]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/network/networkd-wait-online-link.c
Merge pull request #1668 from ssahani/net1
[thirdparty/systemd.git] / src / network / networkd-wait-online-link.c
index 2d5123788c34e115a077dee612224d61633f69c8..cc4b46d5b07a190e03a44aab8abbe87caf0a0630 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-
 #include "sd-network.h"
 
 #include "networkd-wait-online-link.h"
+#include "string-util.h"
 
 int link_new(Manager *m, Link **ret, int ifindex, const char *ifname) {
         _cleanup_(link_freep) Link *l = NULL;
@@ -120,13 +120,11 @@ int link_update_rtnl(Link *l, sd_netlink_message *m) {
 int link_update_monitor(Link *l) {
         assert(l);
 
-        free(l->operational_state);
-        l->operational_state = NULL;
+        l->operational_state = mfree(l->operational_state);
 
         sd_network_link_get_operational_state(l->ifindex, &l->operational_state);
 
-        free(l->state);
-        l->state = NULL;
+        l->state = mfree(l->state);
 
         sd_network_link_get_setup_state(l->ifindex, &l->state);