device_ledger: fix bad memory access on connect error

This commit is contained in:
moneromooo-monero 2018-06-09 20:49:05 +01:00
parent 25e7a7d96f
commit 03096150c6
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -396,7 +396,7 @@ namespace hw {
} }
} }
if (mszReaders) { if (rv == SCARD_S_SUCCESS && mszReaders) {
#ifdef SCARD_AUTOALLOCATE #ifdef SCARD_AUTOALLOCATE
SCardFreeMemory(this->hContext, mszReaders); SCardFreeMemory(this->hContext, mszReaders);
#else #else