[Pcsclite-cvs-commit] r6707 - trunk/PCSC/src

ludovic.rousseau at free.fr ludovic.rousseau at free.fr
Mon Aug 5 18:38:40 UTC 2013


Author: rousseau
Date: 2013-08-05 18:38:40 +0000 (Mon, 05 Aug 2013)
New Revision: 6707

Modified:
   trunk/PCSC/src/readerfactory.c
Log:
RFCleanupReaders(): fix a memory leak

The sReadersContexts[i] structure allocated in RFAllocateReaderSpace()
was never released on exit.

This is not really a problem unless you embedd pcscd in another process
and do init/deinit pcscd without exiting the process (as maybe used on
Android or iOS).

Thanks to Alan Kozlay for the patch


Modified: trunk/PCSC/src/readerfactory.c
===================================================================
--- trunk/PCSC/src/readerfactory.c	2013-08-02 19:37:54 UTC (rev 6706)
+++ trunk/PCSC/src/readerfactory.c	2013-08-05 18:38:40 UTC (rev 6707)
@@ -1286,6 +1286,8 @@
 
 			if (rv != SCARD_S_SUCCESS)
 				Log2(PCSC_LOG_ERROR, "RFRemoveReader error: 0x%08lX", rv);
+
+			free(sReadersContexts[i]);
 		}
 	}
 }




More information about the Pcsclite-cvs-commit mailing list