From b1729b7368bf10661844c90ac470238eadd1ae7c Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Sat, 21 Sep 2019 16:31:38 +0300 Subject: [PATCH] Fix resource leak. CID 253277 --- gost12sum.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gost12sum.c b/gost12sum.c index 33482a4..b44fe3b 100644 --- a/gost12sum.c +++ b/gost12sum.c @@ -209,6 +209,7 @@ int hash_file(gost_hash_ctx * ctx, char *filename, char *sum, int mode, } if (!hash_stream(ctx, fd, sum, hashsize)) { perror(filename); + close(fd); return 0; } close(fd); -- 2.39.2