-
-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICU-22825 Fix memLeak during error in tznames_impl.cpp #3081
ICU-22825 Fix memLeak during error in tznames_impl.cpp #3081
Conversation
Rewrite the TextTrieMap::put() which should delete the value during error instead of deleting key. Rewrite to simplified the error handling.
02952dd
to
3e676f9
Compare
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is right. I was concerned that you might need to take ownership of both the key and the value, but the documentation says this particular function is for cases where the key is in static memory owned by somebody else (the resource bundle), so I think you're doing the right thing.
@sffc could you double check since you are the one who wrote the origional code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The minimal fix would be to change fValueDeleter((void*) key);
to fValueDeleter(value);
The rest of the refactor looks fine.
no, that will not be enugh because for the last line of |
Checklist