Skip to content

Commit

Permalink
ICU-21809 Possible memory leak of tempTable.resFlags
Browse files Browse the repository at this point in the history
  • Loading branch information
makotokato authored and FrankYFTang committed Jun 18, 2024
1 parent 8f6ba2a commit f48944e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions icu4c/source/common/uresdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,9 @@ ures_swap(const UDataSwapper *ds,
outBundle+keysBottom, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
udata_printError(ds, "ures_swap().udata_swapInvStringBlock(keys[%d]) failed\n", 4*(keysTop-keysBottom));
if(tempTable.resFlags!=stackResFlags) {
uprv_free(tempTable.resFlags);
}
return 0;
}

Expand All @@ -1465,6 +1468,9 @@ ures_swap(const UDataSwapper *ds,
ds->swapArray16(ds, inBundle+keysTop, (resBottom-keysTop)*4, outBundle+keysTop, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
udata_printError(ds, "ures_swap().swapArray16(16-bit units[%d]) failed\n", 2*(resBottom-keysTop));
if(tempTable.resFlags!=stackResFlags) {
uprv_free(tempTable.resFlags);
}
return 0;
}
}
Expand Down

0 comments on commit f48944e

Please sign in to comment.