summaryrefslogtreecommitdiff
path: root/security/nss/lib/libpkix
diff options
context:
space:
mode:
authorkaie%kuix.de <devnull@localhost>2012-06-07 00:12:37 +0000
committerkaie%kuix.de <devnull@localhost>2012-06-07 00:12:37 +0000
commit4a2e055188ec371602a433ab60e0871b0b11fa6c (patch)
tree452784bcbd64a59e66fbd2cc49d6a6369ebd59fc /security/nss/lib/libpkix
parent56e419bc71ed5c6a887a6bedc0d2d4fdf75e986c (diff)
downloadnss-hg-4a2e055188ec371602a433ab60e0871b0b11fa6c.tar.gz
Bug 489188, patch approach 2, fix the leak and preserve original error object, patch by Wan-Teh, r=kaie
Diffstat (limited to 'security/nss/lib/libpkix')
-rwxr-xr-xsecurity/nss/lib/libpkix/pkix/top/pkix_build.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/security/nss/lib/libpkix/pkix/top/pkix_build.c b/security/nss/lib/libpkix/pkix/top/pkix_build.c
index 1a4e773ad..4b1d5e81c 100755
--- a/security/nss/lib/libpkix/pkix/top/pkix_build.c
+++ b/security/nss/lib/libpkix/pkix/top/pkix_build.c
@@ -2991,6 +2991,7 @@ pkix_Build_CheckInCache(
PKIX_PL_Date *testDate = NULL;
PKIX_BuildResult *buildResult = NULL;
PKIX_ValidateResult *valResult = NULL;
+ PKIX_Error *buildError = NULL;
PKIX_TrustAnchor *matchingAnchor = NULL;
PKIX_PL_Cert *trustedCert = NULL;
PKIX_List *certList = NULL;
@@ -3099,16 +3100,20 @@ cleanup:
/* The anchor of this chain is no longer trusted or
* chain cert(s) has been revoked.
* Invalidate this result in the cache */
+ buildError = pkixErrorResult;
PKIX_CHECK_FATAL(pkix_CacheCertChain_Remove
(targetCert,
anchors,
plContext),
PKIX_CACHECERTCHAINREMOVEFAILED);
+ pkixErrorResult = buildError;
+ buildError = NULL;
}
fatal:
PKIX_DECREF(buildResult);
PKIX_DECREF(valResult);
+ PKIX_DECREF(buildError);
PKIX_DECREF(certList);
PKIX_DECREF(matchingAnchor);
PKIX_DECREF(trustedCert);