Bug 294531
authorrrelyea%redhat.com
Thu, 08 Nov 2007 18:08:41 +0000
changeset 8208 7646e1d12b35198e3a0768b632b101dba7de0960
parent 8205 ed9d51d3ac8620209e5e927263a39887447023cc
child 8209 ae770a7e3d7438fc80d42b0e43fe283be3cf774e
push idunknown
push userunknown
push dateunknown
bugs294531
Bug 294531 patch by steve p rew rrelyea.
security/nss/lib/certhigh/certvfy.c
--- a/security/nss/lib/certhigh/certvfy.c
+++ b/security/nss/lib/certhigh/certvfy.c
@@ -2072,43 +2072,42 @@ cert_GetTargetCertConstraints(CERTCertif
     PKIX_CertSelector *certSelector = NULL;
     PKIX_CertSelector *r= NULL;
     PKIX_PL_Cert *eeCert = NULL;
     PKIX_Error *error = NULL;
 
     pkix_pl_Cert_CreateWithNSSCert
 	(target, &eeCert, plContext);
 
+    error = PKIX_CertSelector_Create(NULL, NULL, &certSelector, plContext);
+    if (error != NULL) goto cleanup;
 
     error = PKIX_ComCertSelParams_Create(&certSelParams, plContext);
     if (error != NULL) goto cleanup;
 
     error = PKIX_ComCertSelParams_SetCertificate(
 				certSelParams, eeCert, plContext);
     if (error != NULL) goto cleanup;
 
-    error = PKIX_CertSelector_Create(NULL, NULL, &certSelector, plContext);
-    if (error != NULL) goto cleanup;
-
     error = PKIX_CertSelector_SetCommonCertSelectorParams
 	(certSelector, certSelParams, plContext);
     if (error != NULL) goto cleanup;
 
-    error = PKIX_PL_Object_IncRef((PKIX_PL_Object *)certSelParams, plContext);
-    if (error == NULL) r = certSelParams;
+    error = PKIX_PL_Object_IncRef((PKIX_PL_Object *)certSelector, plContext);
+    if (error == NULL) r = certSelector;
 
 cleanup:
     if (certSelParams != NULL) 
 	PKIX_PL_Object_DecRef((PKIX_PL_Object *)certSelParams, plContext);
 
     if (eeCert != NULL) 
 	PKIX_PL_Object_DecRef((PKIX_PL_Object *)eeCert, plContext);
 
-    if (certSelParams != NULL) 
-	PKIX_PL_Object_DecRef((PKIX_PL_Object *)certSelParams, plContext);
+    if (certSelector != NULL) 
+	PKIX_PL_Object_DecRef((PKIX_PL_Object *)certSelector, plContext);
 
     return r;
 }
 
 
 PKIX_List *
 CERT_GetCertStores(void *plContext)
 {