santigimeno / node-pcsclite

Bindings over pcsclite to access Smart Cards
ISC License
170 stars 125 forks source link

Release memory that has been returned from the resource manager using the SCARD_AUTOALLOCATE (function SCardListReaders) #97

Closed xenon-ua closed 2 years ago

xenon-ua commented 2 years ago

Hello. It looks like a posible bug that leads to a memory leak. File: pcsclite.cpp:262. The SCardListReaders() function allocate memory for readers_name (in case if SCARD_AUTOALLOCATE is defined) and you must release this memory using the SCardFreeMemory() function. I have not found a call of the SCardFreeMemory() function in the source code. Is it ok?

xenon-ua commented 2 years ago

I was wrong. I found where the memory is released