From f87c65d0813e8d8bc20ffe39737b99a944ad913e Mon Sep 17 00:00:00 2001 From: philsmd Date: Tue, 14 Feb 2017 19:12:24 +0100 Subject: [PATCH] minor: check return value of hc_stat () and use fclose () in case of error --- src/opencl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/opencl.c b/src/opencl.c index e3b305e51..57327f9c1 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -306,7 +306,12 @@ static int read_kernel_binary (hashcat_ctx_t *hashcat_ctx, const char *kernel_fi { hc_stat_t st; - hc_stat (kernel_file, &st); + if (hc_stat (kernel_file, &st)) + { + fclose (fp); + + return -1; + } char *buf = (char *) hcmalloc (st.st_size + 1);