r = flink_tmpfile(f, tar, arg_target, LINK_TMPFILE_REPLACE);
if (r < 0)
return log_error_errno(r, "Failed to move archive file into place: %m");
+
+ tar = mfree(tar);
}
return 0;
#include "build.h"
#include "fd-util.h"
#include "fileio.h"
+#include "fs-util.h"
#include "log.h"
#include "main-func.h"
#include "memstream-util.h"
ASN1_STRING_set0(signer_info->enc_digest, TAKE_PTR(pkcs1), pkcs1_len);
_cleanup_fclose_ FILE *output = NULL;
- _cleanup_free_ char *tmp = NULL;
+ _cleanup_(unlink_and_freep) char *tmp = NULL;
r = fopen_tmpfile_linkable(arg_output, O_WRONLY|O_CLOEXEC, &tmp, &output);
if (r < 0)
return log_error_errno(r, "Failed to open temporary file: %m");
if (r < 0)
return log_error_errno(r, "Failed to link temporary file to %s: %m", arg_output);
+ tmp = mfree(tmp);
+
return 0;
}
if (r < 0)
return log_error_errno(r, "Failed to link temporary file to %s: %m", path);
+ t = mfree(t);
+
log_info("%s written.", path);
return 0;
if (r < 0)
return log_error_errno(r, "Failed to link temporary file to %s: %m", path);
+ t = mfree(t);
+
log_info("%s written.", path);
return 0;
if (r < 0)
return r;
+ filename_tmp = mfree(filename_tmp);
+
/* write succeeded */
log_debug("=== trie on-disk ===");
if (r < 0)
return log_error_errno(r, "Failed to move SRK public key file to '%s': %m", tpm2b_public_path);
+ t = mfree(t);
+
log_info("SRK public key saved to '%s' in TPM2B_PUBLIC format.", tpm2b_public_path);
return 0;
}