]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Fix resource leak. CID 253277
authorDmitry Belyavskiy <beldmit@gmail.com>
Sat, 21 Sep 2019 13:31:38 +0000 (16:31 +0300)
committerDmitry Belyavskiy <beldmit@gmail.com>
Sat, 21 Sep 2019 13:31:38 +0000 (16:31 +0300)
gost12sum.c

index 33482a490772a510c338fd5fc1f7323480796158..b44fe3bdb601da32551796e72f7486a26a77d94c 100644 (file)
@@ -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);