[Pcsclite-git-commit] [CCID] 02/02: FreeChannel(): release reader_index only after use

Ludovic Rousseau rousseau at moszumanska.debian.org
Wed Jan 4 12:46:06 UTC 2017


This is an automated email from the git hooks/post-receive script.

rousseau pushed a commit to branch master
in repository CCID.

commit e05426c6c426fc46ef18c7bd17cfb7ad74cabd1c
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date:   Wed Jan 4 13:41:34 2017 +0100

    FreeChannel(): release reader_index only after use
    
    Call ReleaseReaderIndex() to free the reader_index only after it is no
    more used.
    
    It was not problematic since the complete code block is protected by the
    ifdh_context_mutex, but this may change.
---
 src/ifdhandler.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/ifdhandler.c b/src/ifdhandler.c
index d97bd37..20465c6 100644
--- a/src/ifdhandler.c
+++ b/src/ifdhandler.c
@@ -85,11 +85,12 @@ static void FreeChannel(int reader_index)
 #endif
 
 	(void)ClosePort(reader_index);
-	ReleaseReaderIndex(reader_index);
 
 	free(CcidSlots[reader_index].readerName);
 	memset(&CcidSlots[reader_index], 0, sizeof(CcidSlots[reader_index]));
 
+	ReleaseReaderIndex(reader_index);
+
 #ifdef HAVE_PTHREAD
 	(void)pthread_mutex_unlock(&ifdh_context_mutex);
 #endif

-- 
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