]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
scriptreplay: fix error path
authorKarel Zak <kzak@redhat.com>
Thu, 20 Jun 2019 10:00:07 +0000 (12:00 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 8 Oct 2019 11:11:53 +0000 (13:11 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/scriptreplay.c

index ec14d4daf042a758f7b702a9df4a88db4409753a..778cd59d0a3a6d1efa2283256bbb582aa7877159 100644 (file)
@@ -149,7 +149,7 @@ static int replay_set_timing_file(struct replay_setup *stp, const char *filename
                        rc = -errno;
        }
 
-       if (rc) {
+       if (rc && stp->timing_fp) {
                fclose(stp->timing_fp);
                stp->timing_fp = NULL;
        }