mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-2030 fix uprv_realloc for buffer!=zeroMem but size==0
X-SVN-Rev: 9607
This commit is contained in:
parent
3e90f91c62
commit
f117f17673
1 changed files with 4 additions and 1 deletions
|
@ -34,8 +34,11 @@ uprv_malloc(size_t s) {
|
|||
|
||||
U_CAPI void * U_EXPORT2
|
||||
uprv_realloc(void * buffer, size_t size) {
|
||||
if (buffer == zeroMem || size == 0) {
|
||||
if (buffer == zeroMem) {
|
||||
return uprv_malloc(size);
|
||||
} else if (size == 0) {
|
||||
free(buffer);
|
||||
return (void *)zeroMem;
|
||||
} else {
|
||||
return realloc(buffer, size);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue