tree-wide: fix use of flink_tmpfile()
Let's always make sure the temporary file returned by fopen_tmpfile() and friends is removed on failure (via _cleanup_). Conversely, make sure that once the file is renamed into its final place, we no longer try to remove the temporary file (since it's not going to exist anymore).
This commit is contained in:
committed by
Daan De Meyer
parent
b9df3d6447
commit
22b5ddb90f
@@ -409,6 +409,8 @@ static int trie_store(struct trie *trie, const char *filename, bool compat) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
filename_tmp = mfree(filename_tmp);
|
||||
|
||||
/* write succeeded */
|
||||
|
||||
log_debug("=== trie on-disk ===");
|
||||
|
||||
Reference in New Issue
Block a user