From b3f9c17a6b361bf98e79a0228cdcb09afc40d1cc Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 11 Feb 2021 05:48:10 +0900 Subject: tree-wide: use free_and_strdup_warn() --- src/network/networkd-manager.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/network/networkd-manager.c') diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index 0e00cde87a..d7e0662453 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -1178,8 +1178,9 @@ int manager_set_hostname(Manager *m, const char *hostname) { log_debug("Setting transient hostname: '%s'", strna(hostname)); - if (free_and_strdup(&m->dynamic_hostname, hostname) < 0) - return log_oom(); + r = free_and_strdup_warn(&m->dynamic_hostname, hostname); + if (r < 0) + return r; if (!m->bus || sd_bus_is_ready(m->bus) <= 0) { log_debug("Not connected to system bus, setting hostname later."); @@ -1227,8 +1228,9 @@ int manager_set_timezone(Manager *m, const char *tz) { assert(tz); log_debug("Setting system timezone: '%s'", tz); - if (free_and_strdup(&m->dynamic_timezone, tz) < 0) - return log_oom(); + r = free_and_strdup_warn(&m->dynamic_timezone, tz); + if (r < 0) + return r; if (!m->bus || sd_bus_is_ready(m->bus) <= 0) { log_debug("Not connected to system bus, setting timezone later."); -- cgit v1.2.3