bug 892017 - fix incorrect usage of PLArenaPool in OCSPStaplingServer r=bsmith
authorDavid Keeler <dkeeler@mozilla.com>
Fri, 19 Jul 2013 11:54:10 -0700
changeset 139328 6b41552ecce112fb332be378e2677dfb26d0d35c
parent 139287 81cae114022a8db6d324b34fc4c9d73a86452e0e
child 139329 1273e2556a0f7e78af36a42f4c59f8c7025dc7de
push id24988
push useremorley@mozilla.com
push dateMon, 22 Jul 2013 13:46:20 +0000
treeherdermozilla-central@f80683d8c3e7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmith
bugs892017
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 892017 - fix incorrect usage of PLArenaPool in OCSPStaplingServer r=bsmith
security/manager/ssl/tests/unit/test_ocsp_stapling/OCSPStaplingServer.cpp
--- a/security/manager/ssl/tests/unit/test_ocsp_stapling/OCSPStaplingServer.cpp
+++ b/security/manager/ssl/tests/unit/test_ocsp_stapling/OCSPStaplingServer.cpp
@@ -448,27 +448,30 @@ DoSNISocketConfig(PRFileDesc *aFd, const
 
   SSLKEAType certKEA = NSS_FindCertKEAType(cert);
 
   if (SSL_ConfigSecureServer(aFd, cert, key, certKEA) != SECSuccess) {
     PrintPRError("SSL_ConfigSecureServer failed");
     return SSL_SNI_SEND_ALERT;
   }
 
-  PLArenaPool arena;
-  PL_InitArenaPool(&arena, "OCSP response", 1024, 0);
-  // response is contained by the arena - finishing the arena will free it
-  SECItemArray *response = GetOCSPResponseForType(host->mOSRT, cert, &arena);
+  PLArenaPool *arena = PORT_NewArena(1024);
+  if (!arena) {
+    PrintPRError("PORT_NewArena failed");
+    return SSL_SNI_SEND_ALERT;
+  }
+  // response is contained by the arena - freeing the arena will free it
+  SECItemArray *response = GetOCSPResponseForType(host->mOSRT, cert, arena);
   if (!response) {
-    PL_FinishArenaPool(&arena);
+    PORT_FreeArena(arena, PR_FALSE);
     return SSL_SNI_SEND_ALERT;
   }
   // SSL_SetStapledOCSPResponses makes a deep copy of response
   SECStatus st = SSL_SetStapledOCSPResponses(aFd, response, certKEA);
-  PL_FinishArenaPool(&arena);
+  PORT_FreeArena(arena, PR_FALSE);
   if (st != SECSuccess) {
     PrintPRError("SSL_SetStapledOCSPResponses failed");
     return SSL_SNI_SEND_ALERT;
   }
 
   return 0;
 }