]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
script-playutils: close filestream in case ignore_line() fails
authorThomas Weißschuh <thomas@t-8ch.de>
Wed, 27 Sep 2023 21:30:27 +0000 (23:30 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Thu, 28 Sep 2023 06:14:43 +0000 (08:14 +0200)
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
term-utils/script-playutils.c

index 89656ab40383dfeb07b48cd2ab71d3230084ee8b..1dec1afc81174053ecf44336b43f232b0473e06b 100644 (file)
@@ -252,6 +252,8 @@ int replay_associate_log(struct replay_setup *stp,
 
        if (rc == 0)
                replay_new_log(stp, streams, filename, f);
+       else if (f)
+               fclose(f);
 
        DBG(LOG, ul_debug("associate log file '%s', streams '%s' [rc=%d]", filename, streams, rc));
        return rc;