[Pcsclite-cvs-commit] r5557 - /trunk/PCSC/src/winscard_clnt.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Thu Jan 27 10:55:25 UTC 2011


Author: rousseau
Date: Thu Jan 27 10:55:25 2011
New Revision: 5557

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5557
Log:
SCardGetAttrib(): 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=5557&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_clnt.c (original)
+++ trunk/PCSC/src/winscard_clnt.c Thu Jan 27 10:55:25 2011
@@ -2513,7 +2513,10 @@
 	PROFILE_START
 
 	if (NULL == pcbAttrLen)
-		return SCARD_E_INVALID_PARAMETER;
+	{
+		ret = SCARD_E_INVALID_PARAMETER;
+		goto end;
+	}
 
 	if (SCARD_AUTOALLOCATE == *pcbAttrLen)
 	{
@@ -2523,7 +2526,10 @@
 		*pcbAttrLen = MAX_BUFFER_SIZE;
 		buf = malloc(*pcbAttrLen);
 		if (NULL == buf)
-			return SCARD_E_NO_MEMORY;
+		{
+			ret = SCARD_E_NO_MEMORY;
+			goto end;
+		}
 
 		*(unsigned char **)pbAttr = buf;
 	}
@@ -2540,6 +2546,7 @@
 	ret = SCardGetSetAttrib(hCard, SCARD_GET_ATTRIB, dwAttrId, buf,
 		pcbAttrLen);
 
+end:
 	PROFILE_END(ret)
 
 	return ret;




More information about the Pcsclite-cvs-commit mailing list