Closed Bug 1020565 Opened 10 years ago Closed 3 years ago

ICUService::getKey leaks |idToCache| if |isBogus|

Categories

(Core :: JavaScript: Internationalization API, defect)

defect
Not set
normal

Tracking

()

RESOLVED MOVED

People

(Reporter: mccr8, Unassigned)

References

(Blocks 1 open bug, )

Details

(Keywords: coverity, memory-leak, Whiteboard: [CID 1158226])

It should call |delete| on |idToCache| if it isn't null.

            UnicodeString* idToCache = new UnicodeString(currentDescriptor);
            if (idToCache == NULL || idToCache->isBogus()) {
                status = U_MEMORY_ALLOCATION_ERROR;
                return NULL;
            }
Whiteboard: [CID 1158226] → [CID 1158226] [mentor=mccr8] [good first bug]
We should fix this upstream in ICU, and then downstream the fix, I guess.

Source location is at http://mxr.mozilla.org/mozilla-central/source/intl/icu/source/common/serv.cpp#532 in our ICU import, and http://source.icu-project.org/repos/icu/icu/trunk/source/common/serv.cpp in the upstream source.
There's a bajillion Coverity warnings for ICU, FYI.
Mentor: continuation
Whiteboard: [CID 1158226] [mentor=mccr8] [good first bug] → [CID 1158226] [good first bug]
I'm removing the mentor stuff here because Waldo points out that actually dealing with all the upstreaming stuff for ICU will probably be a pain.
Mentor: continuation
Whiteboard: [CID 1158226] [good first bug] → [CID 1158226]
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → MOVED
You need to log in before you can comment on or make changes to this bug.