[Pcsclite-cvs-commit] CVS PKCS11/src

CVS User rousseau ludovic.rousseau@free.fr
Sun, 28 Nov 2004 07:11:52 -0700


Update of /cvsroot/muscleapps/PKCS11/src
In directory haydn:/tmp/cvs-serv19402

Modified Files:
	p11_object.c 
Log Message:
C_FindObjectsInit(): correctly exits if the memory is exhausted

Thanks to Peter Stamfest for the patch


--- /cvsroot/muscleapps/PKCS11/src/p11_object.c	2004/11/28 14:09:20	1.24
+++ /cvsroot/muscleapps/PKCS11/src/p11_object.c	2004/11/28 14:11:52	1.25
@@ -1,6 +1,6 @@
 /******************************************************************************
 ** 
-**  $Id: p11_object.c,v 1.24 2004/11/28 14:09:20 rousseau Exp $
+**  $Id: p11_object.c,v 1.25 2004/11/28 14:11:52 rousseau Exp $
 **
 **  Package: PKCS-11
 **  Author : Chris Osgood <oznet@mac.com>
@@ -505,8 +505,10 @@
             /* Fixme: Big problem? May need to malloc the pValue for the local search attributes. */
             /*        Otherwise it uses the memory pointer back into the calling application. */
             session->search_attrib = (CK_ATTRIBUTE *)calloc(ulCount, sizeof(CK_ATTRIBUTE));
-            if (!session->search_attrib)
+            if (NULL == session->search_attrib) {
                 rv = CKR_HOST_MEMORY;
+				goto finish;
+			}
             else
             {
 		int i;