From 1d9deeee9ba61a82418a37d4c02bdecde869d61b Mon Sep 17 00:00:00 2001 From: "alexei.volkov.bugs%sun.com" Date: Mon, 15 May 2006 21:05:20 +0000 Subject: [PATCH] [Bug 336482] crash or hopefully deadcode [@ crmf_copy_poposigningkey] because Pointer "destPopoSignKey" dereferenced before NULL check. r=nelson git-svn-id: svn://10.0.0.236/trunk@196597 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/security/nss/lib/crmf/servget.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/mozilla/security/nss/lib/crmf/servget.c b/mozilla/security/nss/lib/crmf/servget.c index 45b056fa487..85be9e55634 100644 --- a/mozilla/security/nss/lib/crmf/servget.c +++ b/mozilla/security/nss/lib/crmf/servget.c @@ -409,7 +409,7 @@ crmf_copy_poposigningkey(PRArenaPool *poolp, } return SECSuccess; loser: - if (destPopoSignKey && poolp == NULL) { + if (poolp == NULL) { CRMF_DestroyPOPOSigningKey(destPopoSignKey); } return SECFailure; @@ -440,13 +440,10 @@ crmf_copy_popoprivkey(PRArenaPool *poolp, rv = SECFailure; } - if (rv != SECSuccess) { - if (destPrivKey && poolp == NULL) { - CRMF_DestroyPOPOPrivKey(destPrivKey); - } - return SECFailure; + if (rv != SECSuccess && poolp == NULL) { + CRMF_DestroyPOPOPrivKey(destPrivKey); } - return SECSuccess; + return rv; } static CRMFProofOfPossession*