From 03096150c626066bedf451846e6dbedd995df1aa Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 9 Jun 2018 20:49:05 +0100 Subject: device_ledger: fix bad memory access on connect error --- src/device/device_ledger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/device/device_ledger.cpp') diff --git a/src/device/device_ledger.cpp b/src/device/device_ledger.cpp index 3b9ab6744..641fe74c3 100644 --- a/src/device/device_ledger.cpp +++ b/src/device/device_ledger.cpp @@ -396,7 +396,7 @@ namespace hw { } } - if (mszReaders) { + if (rv == SCARD_S_SUCCESS && mszReaders) { #ifdef SCARD_AUTOALLOCATE SCardFreeMemory(this->hContext, mszReaders); #else -- cgit v1.2.3