Closed Bug 1529959 Opened 5 years ago Closed 5 years ago

memory leaks in atob/btoa

Categories

(NSS :: Tools, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: KaiE, Assigned: KaiE)

References

Details

Attachments

(1 file, 1 obsolete file)

The NSS helper tools atob and btoa don't destroy the optstate.
I saw that in the try build for bug 1529950

https://treeherder.mozilla.org/#/jobs?repo=nss-try&revision=d002f0ca2da88fbef464505ef17e59657f28c2bc

Assignee: nobody → kaie
Attached patch 1529959-v1.patch (obsolete) — Splinter Review
Attachment #9045990 - Flags: review?(jjones)
Comment on attachment 9045990 [details] [diff] [review]
1529959-v1.patch

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

For all the early returns, let's destroy the opstate too, and then we won't have to worry about touching these again for a while. :)

::: cmd/atob/atob.c
@@ +145,4 @@
>                  if (!outFile) {
>                      fprintf(stderr, "%s: unable to open \"%s\" for writing\n",
>                              progName, optstate->value);
>                      return -1;

note we'll still leak for all the early returns
Attachment #9045990 - Flags: review?(jjones) → review-

(note, both utils)

Attached patch 1529959-v2.patchSplinter Review

You're right, we should cleanup completley, but that made the patch much bigger...

Attachment #9045990 - Attachment is obsolete: true
Attachment #9046119 - Flags: review?(jjones)
Comment on attachment 9046119 [details] [diff] [review]
1529959-v2.patch

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

Thanks, Kai.
Attachment #9046119 - Flags: review?(jjones) → review+
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.43
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: