[Pcsclite-cvs-commit] r5550 - /trunk/PCSC/src/winscard_clnt.c
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Tue Jan 25 15:49:09 UTC 2011
Author: rousseau
Date: Tue Jan 25 15:49:08 2011
New Revision: 5550
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5550
Log:
SCardReleaseContext(): 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=5550&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_clnt.c (original)
+++ trunk/PCSC/src/winscard_clnt.c Tue Jan 25 15:49:08 2011
@@ -721,8 +721,8 @@
currentContextMap = SCardGetContext(hContext);
if (NULL == currentContextMap)
{
- PROFILE_END(SCARD_E_INVALID_HANDLE)
- return SCARD_E_INVALID_HANDLE;
+ rv = SCARD_E_INVALID_HANDLE;
+ goto error;
}
(void)pthread_mutex_lock(currentContextMap->mMutex);
@@ -733,7 +733,10 @@
/* the context 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;
+ }
scReleaseStruct.hContext = hContext;
scReleaseStruct.rv = SCARD_S_SUCCESS;
@@ -765,6 +768,7 @@
(void)SCardRemoveContext(hContext);
(void)SCardUnlockThread();
+error:
PROFILE_END(rv)
API_TRACE_OUT("")
More information about the Pcsclite-cvs-commit
mailing list