svn rev #24365: branches/nss/src/lib/crypto/nss/enc_provider/

ghudson@MIT.EDU ghudson at MIT.EDU
Mon Sep 27 19:26:03 EDT 2010


http://src.mit.edu/fisheye/changelog/krb5/?cs=24365
Commit By: ghudson
Log Message:
Use the PK11_DestroyContext() instead of PK11_Finalize() to destroy
crypto contexts in enc_gen.c; the latter seems to leak references.



Changed Files:
U   branches/nss/src/lib/crypto/nss/enc_provider/enc_gen.c
Modified: branches/nss/src/lib/crypto/nss/enc_provider/enc_gen.c
===================================================================
--- branches/nss/src/lib/crypto/nss/enc_provider/enc_gen.c	2010-09-27 19:05:29 UTC (rev 24364)
+++ branches/nss/src/lib/crypto/nss/enc_provider/enc_gen.c	2010-09-27 23:26:03 UTC (rev 24365)
@@ -262,7 +262,7 @@
     }
 done:
     if (ctx)
-         PK11_Finalize(ctx);
+        PK11_DestroyContext(ctx, PR_TRUE);
     if (param)
         SECITEM_FreeItem(param, PR_TRUE);
     return ret;
@@ -290,7 +290,7 @@
 
     /* Clean up the OpenSSL context if it was initialized. */
     if (sstate && sstate->loopback == sstate)
-        PK11_Finalize(sstate->ctx);
+        PK11_DestroyContext(sstate->ctx, PR_TRUE);
     free(sstate);
     return 0;
 }
@@ -350,7 +350,7 @@
     }
 done:
     if (!state && ctx)
-         PK11_Finalize(ctx);
+        PK11_DestroyContext(ctx, PR_TRUE);
     return ret;
 }
 
@@ -539,7 +539,7 @@
 
 done:
     if (ctx)
-         PK11_Finalize(ctx);
+        PK11_DestroyContext(ctx, PR_TRUE);
     if (param)
         SECITEM_FreeItem(param, PR_TRUE);
     return ret;
@@ -655,7 +655,7 @@
         ret = k5_nss_map_last_error();
         goto done;
     }
-    PK11_Finalize(ctx);
+    PK11_DestroyContext(ctx, PR_TRUE);
     ctx = NULL;
 
     /* Now now we have a 'wrapped' version of the, we can import it into
@@ -677,7 +677,7 @@
         PK11_FreeSlot(slot);
 #ifdef FAKE_FIPS
     if (ctx)
-        PK11_Finalize(ctx);
+        PK11_DestroyContext(ctx, PR_TRUE);
     if (wrapping_key)
         PK11_FreeSymKey(wrapping_key);
 #endif




More information about the cvs-krb5 mailing list