summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 30d9c43fbb..9985510161 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1586,9 +1586,9 @@ int main(int argc, char *argv[]) {
/* Initialize default unit */
if (!arg_default_unit) {
- r = free_and_strdup(&arg_default_unit, SPECIAL_DEFAULT_TARGET);
- if (r < 0) {
- log_emergency_errno(r, "Failed to set default unit %s: %m", SPECIAL_DEFAULT_TARGET);
+ arg_default_unit = strdup(SPECIAL_DEFAULT_TARGET);
+ if (!arg_default_unit) {
+ r = log_oom();
error_message = "Failed to set default unit";
goto finish;
}