Closed Bug 1298712 Opened 8 years ago Closed 8 years ago

Fix up CertReq()

Categories

(NSS :: Libraries, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1317118

People

(Reporter: n.nethercote, Assigned: n.nethercote)

Details

(Keywords: coverity, Whiteboard: [CID 1369095, CID 1369096])

Attachments

(1 file)

Coverity is reporting some problems in CertReq(): two resource leaks in error paths, and a missing failure check.
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
Comment on attachment 8785729 [details] [diff] [review]
Fix minor resource leaks and a missing failure check in CertReq

Review of attachment 8785729 [details] [diff] [review]:
-----------------------------------------------------------------

I think that I might have seen a similar patch for the same problems elsewhere.
Attachment #8785729 - Flags: superreview?(franziskuskiefer)
Attachment #8785729 - Flags: review?(martin.thomson)
Attachment #8785729 - Flags: review+
Comment on attachment 8785729 [details] [diff] [review]
Fix minor resource leaks and a missing failure check in CertReq

Review of attachment 8785729 [details] [diff] [review]:
-----------------------------------------------------------------

Yeah, parts of this were fixed already. The patch should end up with only the first change after rebasing.

::: security/nss/cmd/certutil/certutil.c
@@ +217,5 @@
> +        if (rv != SECSuccess) {
> +            SECU_PrintError(progName, "Could not set signature algorithm id.");
> +            PORT_FreeArena(arena, PR_FALSE);
> +            return SECFailure;
> +        }

this got fixed already

@@ +225,5 @@
>      cr = CERT_CreateCertificateRequest(subject, spki, NULL);
>      SECKEY_DestroySubjectPublicKeyInfo(spki);
>      if (!cr) {
>          SECU_PrintError(progName, "unable to make certificate request");
> +        PORT_FreeArena(arena, PR_FALSE);

this one as well
Attachment #8785729 - Flags: superreview?(franziskuskiefer) → superreview+
Does this still need to be open?
This got fixed in bug 1317118
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: