--- icu/source/i18n/smpdtfmt.cpp.orig 2014-08-27 10:29:29.849821672 +0530 +++ icu/source/i18n/smpdtfmt.cpp 2014-08-27 10:29:49.323821401 +0530 @@ -1082,6 +1082,7 @@ } } else { status = U_MEMORY_ALLOCATION_ERROR; + return; } } umtx_unlock(&LOCK); --- icu/source/common/usprep.cpp.orig 2014-08-27 10:38:24.360821077 +0530 +++ icu/source/common/usprep.cpp 2014-08-27 10:38:38.696821312 +0530 @@ -796,16 +796,23 @@ usprep_prepare( const UStringPrepProfi } CLEANUP: - if(b1!=b1Stack){ - uprv_free(b1); - b1=NULL; - } - - if(b2!=b1Stack && b2!=b2Stack && b2!=b1 /* b1 should not be freed twice */){ - uprv_free(b2); - b2=NULL; - } - return u_terminateUChars(dest, destCapacity, b2Len, status); + if(b2==b1 && b1!=b1Stack){ + uprv_free(b1); + b1=NULL; + b2=NULL; + } + else + { + if(b1!=b1Stack){ + uprv_free(b1); + b1=NULL; + } + if(b2!=b1Stack && b2!=b2Stack && b2!=b1 /* b1 should not be freed twice */){ + uprv_free(b2); + b2=NULL; + } + } + return u_terminateUChars(dest, destCapacity, b2Len, status); } --- icu/source/common/ubidi.c.orig 2014-08-29 14:32:24.007259924 +0100 +++ icu/source/common/ubidi.c 2014-08-29 14:33:21.555833532 +0100 @@ -2521,11 +2521,18 @@ pBiDi->trailingWSStart=saveTrailingWSStart; /* free memory for mapping table and visual text */ uprv_free(runsOnlyMemory); + runsOnlyMemory=NULL; if(pBiDi->runCount>1) { pBiDi->direction=UBIDI_MIXED; } cleanup3: - pBiDi->reorderingMode=UBIDI_REORDER_RUNS_ONLY; + if(runsOnlyMemory != NULL) + { + pBiDi->reorderingMode=UBIDI_REORDER_RUNS_ONLY; + uprv_free(runsOnlyMemory); + } + else + pBiDi->reorderingMode=UBIDI_REORDER_RUNS_ONLY; } /* ubidi_setPara ------------------------------------------------------------ */