Bugzilla bug 228618: fixed an incorrect use of realloc. Fixed an unused

variable compiler warning.  r=jpierre.
This commit is contained in:
wchang0222%aol.com 2003-12-16 04:24:57 +00:00
Родитель 0553a335c1
Коммит 704e59f314
1 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -32,7 +32,7 @@
*/ */
#ifdef DEBUG #ifdef DEBUG
static const char CVS_ID[] = "@(#) $RCSfile: pkibase.c,v $ $Revision: 1.21 $ $Date: 2003-08-01 02:02:47 $ $Name: $"; static const char CVS_ID[] = "@(#) $RCSfile: pkibase.c,v $ $Revision: 1.22 $ $Date: 2003-12-16 04:24:57 $ $Name: $";
#endif /* DEBUG */ #endif /* DEBUG */
#ifndef DEV_H #ifndef DEV_H
@ -217,12 +217,11 @@ nssPKIObject_RemoveInstanceForToken (
} }
} }
if (--object->numInstances > 0) { if (--object->numInstances > 0) {
object->instances = nss_ZREALLOCARRAY(object->instances, nssCryptokiObject **instances = nss_ZREALLOCARRAY(object->instances,
nssCryptokiObject *, nssCryptokiObject *,
object->numInstances); object->numInstances);
if (!object->instances) { if (instances) {
PZ_Unlock(object->lock); object->instances = instances;
return PR_FAILURE;
} }
} else { } else {
nss_ZFreeIf(object->instances); nss_ZFreeIf(object->instances);
@ -244,10 +243,12 @@ nssPKIObject_DeleteStoredObject (
{ {
PRUint32 i, numNotDestroyed; PRUint32 i, numNotDestroyed;
PRStatus status = PR_SUCCESS; PRStatus status = PR_SUCCESS;
#ifndef NSS_3_4_CODE
NSSTrustDomain *td = object->trustDomain; NSSTrustDomain *td = object->trustDomain;
NSSCallback *pwcb = uhh ? /* is this optional? */ NSSCallback *pwcb = uhh ? /* is this optional? */
uhh : uhh :
nssTrustDomain_GetDefaultCallback(td, NULL); nssTrustDomain_GetDefaultCallback(td, NULL);
#endif
numNotDestroyed = 0; numNotDestroyed = 0;
PZ_Lock(object->lock); PZ_Lock(object->lock);
for (i=0; i<object->numInstances; i++) { for (i=0; i<object->numInstances; i++) {