Closed
Bug 1715979
Opened 3 years ago
Closed 3 years ago
DateTimePatternGenerator and Enumeration move assignment operator leaks
Categories
(Core :: Internationalization, defect, P1)
Core
Internationalization
Tracking
()
RESOLVED
FIXED
91 Branch
Tracking | Status | |
---|---|---|
firefox91 | --- | fixed |
People
(Reporter: anba, Assigned: gregtatum)
References
Details
(Whiteboard: [i18n-unification])
Attachments
(1 file)
Enumeration& operator=(Enumeration&& other) noexcept {
if (this != &other) {
mUEnumeration = other.mUEnumeration;
other.mUEnumeration = nullptr;
}
}
The operator should call uenum_close
before the assignment mUEnumeration = other.mUEnumeration
.
A similar issue is present in DateTimePatternGenerator
.
Updated•3 years ago
|
Severity: -- → S3
Flags: needinfo?(gtatum)
Priority: -- → P1
Assignee | ||
Comment 1•3 years ago
|
||
I don't think this is correct. Why would uenum_close
be called when the pointer is being moved to another owner? The resource's ownership is being moved, and shouldn't be closed. Closing the resource, then transferring it to a new owner would cause a crash when the resource is then used.
Flags: needinfo?(gtatum)
Reporter | ||
Comment 2•3 years ago
|
||
this->mUEnumeration
should be closed before it's overwritten with other.mUEnumeration
, right?
Assignee | ||
Comment 3•3 years ago
|
||
Ah, I investigated this more, and yes you are correct. I don't think the current implementation leaks, but future uses can. This should be fixed.
Assignee | ||
Comment 4•3 years ago
|
||
Updated•3 years ago
|
Assignee: nobody → gtatum
Status: NEW → ASSIGNED
Pushed by gtatum@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/caa6a6bbe97d
Do not leak ICU objects in mozilla:intl component moves; r=nordzilla
Comment 6•3 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
Updated•3 years ago
|
Whiteboard: [i18n-unification]
You need to log in
before you can comment on or make changes to this bug.
Description
•