From cc1dca7a2b55e0d2e14588414162a86ca2ca2354 Mon Sep 17 00:00:00 2001
From: jsteube <jens.steube@gmail.com>
Date: Fri, 2 Dec 2016 20:39:42 +0100
Subject: [PATCH] Fixed double free (actually, double fclose()) in opencl.c

---
 docs/changes.txt | 8 ++++++++
 src/opencl.c     | 2 --
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/docs/changes.txt b/docs/changes.txt
index bc52125f2..062d32f17 100644
--- a/docs/changes.txt
+++ b/docs/changes.txt
@@ -1,3 +1,11 @@
+* changes v3.20 -> ???:
+
+##
+## Bugs
+##
+
+- Fixed double free (actually, double fclose()) in opencl.c
+
 * changes v3.10 -> v3.20:
 
 The hashcat core was completely refactored to be a MT-safe library (libhashcat).
diff --git a/src/opencl.c b/src/opencl.c
index a593c1dd1..490476c5d 100644
--- a/src/opencl.c
+++ b/src/opencl.c
@@ -75,8 +75,6 @@ static int ocl_check_dri (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx)
 
   if (vendor != 4098) return 0;
 
-  fclose (fd_drm);
-
   // Now the problem is only with AMDGPU-Pro, not with oldschool AMD driver
 
   char buf[HCBUFSIZ_TINY];