From fdbf132625984fd05d66816f84ff807b0f6726df Mon Sep 17 00:00:00 2001 From: cyealy Date: Thu, 4 Jun 2020 12:01:10 -0400 Subject: [PATCH 1/2] Fixed event handle leak in fpga_send and fpga_recv --- c_c++/windows/x64/riffa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/c_c++/windows/x64/riffa.c b/c_c++/windows/x64/riffa.c index e7ee501..67496a3 100755 --- a/c_c++/windows/x64/riffa.c +++ b/c_c++/windows/x64/riffa.c @@ -150,6 +150,7 @@ int RIFFACALL fpga_send(fpga_t * fpga, int chnl, void * data, int len, printf("Error in DeviceIoControl: %d\n", GetLastError()); } } + CloseHandle(evt); return wordsReturned; } @@ -198,6 +199,7 @@ int RIFFACALL fpga_recv(fpga_t * fpga, int chnl, void * data, int len, printf("Error in DeviceIoControl: %d\n", GetLastError()); } } + CloseHandle(evt); return wordsReturned; } From 8fbe95f1d6dc1a23e9e0d02bfe635bd2070b4eb1 Mon Sep 17 00:00:00 2001 From: cyealy Date: Thu, 4 Jun 2020 12:02:31 -0400 Subject: [PATCH 2/2] Fixed event handle leak in fpga_send and fpga_recv --- c_c++/windows/x86/riffa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/c_c++/windows/x86/riffa.c b/c_c++/windows/x86/riffa.c index e7ee501..67496a3 100755 --- a/c_c++/windows/x86/riffa.c +++ b/c_c++/windows/x86/riffa.c @@ -150,6 +150,7 @@ int RIFFACALL fpga_send(fpga_t * fpga, int chnl, void * data, int len, printf("Error in DeviceIoControl: %d\n", GetLastError()); } } + CloseHandle(evt); return wordsReturned; } @@ -198,6 +199,7 @@ int RIFFACALL fpga_recv(fpga_t * fpga, int chnl, void * data, int len, printf("Error in DeviceIoControl: %d\n", GetLastError()); } } + CloseHandle(evt); return wordsReturned; }