X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/3d1f044b704633e2e541231cd17ae9ecf9ad5c7a..refs/heads/master:/icuSources/test/cintltst/nucnvtst.c diff --git a/icuSources/test/cintltst/nucnvtst.c b/icuSources/test/cintltst/nucnvtst.c index ba8d1313..e85c4d07 100644 --- a/icuSources/test/cintltst/nucnvtst.c +++ b/icuSources/test/cintltst/nucnvtst.c @@ -3095,17 +3095,18 @@ TestHZ() { UChar *uTarget; char *cTarget; const char *cTargetLimit; - char *cBuf; - UChar *uBuf,*test; + char *cBuf = NULL; + UChar *uBuf = NULL; + UChar *test; int32_t uBufSize = 120; UErrorCode errorCode=U_ZERO_ERROR; - UConverter *cnv; + UConverter *cnv = NULL; int32_t* offsets = (int32_t*) malloc(uBufSize * sizeof(int32_t) * 5); int32_t* myOff= offsets; cnv=ucnv_open("HZ", &errorCode); if(U_FAILURE(errorCode)) { log_data_err("Unable to open HZ converter: %s\n", u_errorName(errorCode)); - return; + goto cleanup; } uBuf = (UChar*)malloc(uBufSize * sizeof(UChar)*5); @@ -3119,7 +3120,7 @@ TestHZ() { ucnv_fromUnicode( cnv , &cTarget, cTargetLimit,&uSource,uSourceLimit,myOff,TRUE, &errorCode); if(U_FAILURE(errorCode)){ log_err("ucnv_fromUnicode conversion failed reason %s\n", u_errorName(errorCode)); - return; + goto cleanup; } cSource = cBuf; cSourceLimit =cTarget; @@ -3128,7 +3129,7 @@ TestHZ() { ucnv_toUnicode(cnv,&uTarget,uTargetLimit,&cSource,cSourceLimit,myOff,TRUE,&errorCode); if(U_FAILURE(errorCode)){ log_err("ucnv_toUnicode conversion failed reason %s\n", u_errorName(errorCode)); - return; + goto cleanup; } uSource = (const UChar*)in; while(uSource UCNV_IRREGULAR) { return; }