From 591437d302cb6d934c6ef3a4779cf159b8248a55 Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Sat, 12 May 2018 12:35:34 +0100 Subject: [PATCH] Add missing fclose after tape format detection. Without this, doing something like: devmount mta0 /tmp/foo devunmount mta0 (i.e. without specifying fmt=bar to the devmount) will leak a FILE * and file descriptor. --- src/vmtape.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vmtape.c b/src/vmtape.c index 1ac985b..c5b858b 100644 --- a/src/vmtape.c +++ b/src/vmtape.c @@ -886,6 +886,8 @@ vmt_rdmount(register struct vmtape *t, return FALSE; } dfn = ta->vmta_path; + fclose(df); + df = NULL; } havefmt: if (vmtfmttab[fmt].tf_flags & (VMTFF_CTL | VMTFF_XCTL)) {