diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-03-11 22:20:51 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-03-11 22:20:54 +0900 |
commit | 0a742f3622531f4871506ff43e994c8dcf7c782d (patch) | |
tree | 88083629101de48a96bf1c2372f2add905bf280c /src/shared/edit-util.c | |
parent | aec8200b12bb8ebce2be87e0261e3a205eaa63d5 (diff) | |
download | systemd-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.c | 2 |
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; |