[Pcsclite-cvs-commit] r5544 - /trunk/PCSC/src/winscard_clnt.c
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Tue Jan 25 14:37:50 UTC 2011
Author: rousseau
Date: Tue Jan 25 14:37:48 2011
New Revision: 5544
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5544
Log:
SCardDisconnect(): Always exit from the same point so that profiling
does work even in case of error
Modified:
trunk/PCSC/src/winscard_clnt.c
Modified: trunk/PCSC/src/winscard_clnt.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard_clnt.c?rev=5544&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_clnt.c (original)
+++ trunk/PCSC/src/winscard_clnt.c Tue Jan 25 14:37:48 2011
@@ -1068,7 +1068,10 @@
rv = SCardGetContextAndChannelFromHandle(hCard, ¤tContextMap,
&pChannelMap);
if (rv == -1)
- return SCARD_E_INVALID_HANDLE;
+ {
+ rv = SCARD_E_INVALID_HANDLE;
+ goto error;
+ }
(void)pthread_mutex_lock(currentContextMap->mMutex);
@@ -1079,7 +1082,10 @@
/* the handle is now invalid
* -> another thread may have called SCardReleaseContext
* -> so the mMutex has been unlocked */
- return SCARD_E_INVALID_HANDLE;
+ {
+ rv = SCARD_E_INVALID_HANDLE;
+ goto error;
+ }
scDisconnectStruct.hCard = hCard;
scDisconnectStruct.dwDisposition = dwDisposition;
@@ -1106,6 +1112,7 @@
end:
(void)pthread_mutex_unlock(currentContextMap->mMutex);
+error:
PROFILE_END(rv)
return rv;
More information about the Pcsclite-cvs-commit
mailing list