mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-10 07:39:16 +00:00
ICU-22796 Bugfix: Memory access after uprv_free().
This commit is contained in:
parent
697cb14f08
commit
6e9e120520
1 changed files with 2 additions and 2 deletions
|
@ -2665,11 +2665,11 @@ Locale::setKeywordValue(const char* keywordName, const char* keywordValue, UErro
|
|||
}
|
||||
uprv_strcpy(newFullName, fullName);
|
||||
if (fullName != fullNameBuffer) {
|
||||
// if full Name is already on the heap, need to free it.
|
||||
uprv_free(fullName);
|
||||
if (baseName == fullName) {
|
||||
baseName = newFullName; // baseName should not point to freed memory.
|
||||
}
|
||||
// if full Name is already on the heap, need to free it.
|
||||
uprv_free(fullName);
|
||||
}
|
||||
fullName = newFullName;
|
||||
status = U_ZERO_ERROR;
|
||||
|
|
Loading…
Add table
Reference in a new issue