summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/nvmutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/libreboot-utils/nvmutil.c')
-rw-r--r--util/libreboot-utils/nvmutil.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/util/libreboot-utils/nvmutil.c b/util/libreboot-utils/nvmutil.c
index 8d1b866c..ec41371f 100644
--- a/util/libreboot-utils/nvmutil.c
+++ b/util/libreboot-utils/nvmutil.c
@@ -95,5 +95,22 @@ main(int argc, char *argv[])
static void
exit_cleanup(void)
{
- return;
+ struct xstate *x;
+ struct xfile *f;
+
+ x = xstatus();
+ if (x == NULL)
+ return;
+
+ f = &x->f;
+
+ /* close fds if still open */
+ close_on_eintr(&f->tmp_fd);
+ close_on_eintr(&f->gbe_fd);
+
+ /* unlink tmpfile if it exists */
+ if (f->tname != NULL) {
+ (void) unlink(f->tname);
+ free_and_set_null(&f->tname);
+ }
}