summaryrefslogtreecommitdiff
path: root/src/shared/edit-util.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-03-11 22:20:51 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-03-11 22:20:54 +0900
commit0a742f3622531f4871506ff43e994c8dcf7c782d (patch)
tree88083629101de48a96bf1c2372f2add905bf280c /src/shared/edit-util.c
parentaec8200b12bb8ebce2be87e0261e3a205eaa63d5 (diff)
downloadsystemd-0a742f3622531f4871506ff43e994c8dcf7c782d.tar.gz
edit-util: unlink temporary file on failure
Addresses the suggestion https://github.com/systemd/systemd/pull/26756#discussion_r1133078705.
Diffstat (limited to 'src/shared/edit-util.c')
-rw-r--r--src/shared/edit-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/edit-util.c b/src/shared/edit-util.c
index 207732e320..ba1f4128a0 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;