[Pcsclite-git-commit] [CCID] 01/01: CreateChannel(): cleanup in	case of error
    Ludovic Rousseau 
    rousseau at moszumanska.debian.org
       
    Mon Oct 26 17:33:26 UTC 2015
    
    
  
This is an automated email from the git hooks/post-receive script.
rousseau pushed a commit to branch master
in repository CCID.
commit 9a1932bed605fb3e38d9853449bb33b8791fa142
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date:   Mon Oct 26 16:02:50 2015 +0100
    CreateChannel(): cleanup in case of error
    
    If the initialisation fails after the OpenPortByName() (during the check
    and hack phases) then we need to correctly close the device.
    
    The problem occured on OS X with a Gemalto Pinpad reader.
    The ccid_open_hack_post() failed and the port was not closed.
    usbDevice[reader_index].dev_handle was not set to NULL and the next
    reader plug (any reader) failed because the index was already in use.
---
 src/ifdhandler.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/ifdhandler.c b/src/ifdhandler.c
index 9e125bc..409c355 100644
--- a/src/ifdhandler.c
+++ b/src/ifdhandler.c
@@ -193,8 +193,7 @@ error:
 	if (return_value != IFD_SUCCESS)
 	{
 		/* release the allocated resources */
-		free(CcidSlots[reader_index].readerName);
-		ReleaseReaderIndex(reader_index);
+		IFDHCloseChannel(Lun);
 	}
 
 	return return_value;
-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pcsclite/CCID.git
    
    
More information about the Pcsclite-cvs-commit
mailing list