From 0a742f3622531f4871506ff43e994c8dcf7c782d Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 11 Mar 2023 22:20:51 +0900 Subject: [PATCH] edit-util: unlink temporary file on failure Addresses the suggestion https://github.com/systemd/systemd/pull/26756#discussion_r1133078705. --- src/shared/edit-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/edit-util.c b/src/shared/edit-util.c index 207732e3207..ba1f4128a0d 100644 --- a/src/shared/edit-util.c +++ b/src/shared/edit-util.c @@ -106,7 +106,7 @@ int edit_files_add( } static int create_edit_temp_file(EditFile *e) { - _cleanup_free_ char *temp = NULL; + _cleanup_(unlink_and_freep) char *temp = NULL; unsigned line = 1; int r; -- 2.47.3