X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/73c04bcfe1096173b00431f0cdc742894b15eef0..46f4442e9a5a4f3b98b7c1083586332f6a8a99a4:/icuSources/extra/uconv/uconv.cpp diff --git a/icuSources/extra/uconv/uconv.cpp b/icuSources/extra/uconv/uconv.cpp index a743daf0..b033afec 100644 --- a/icuSources/extra/uconv/uconv.cpp +++ b/icuSources/extra/uconv/uconv.cpp @@ -1,6 +1,6 @@ /***************************************************************************** * -* Copyright (C) 1999-2006, International Business Machines +* Copyright (C) 1999-2008, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************/ @@ -38,6 +38,8 @@ #include "unicode/uwmsg.h" +U_NAMESPACE_USE + #if (defined(U_WINDOWS) || defined(U_CYGWIN)) && !defined(__STRICT_ANSI__) #include #include @@ -257,7 +259,7 @@ static int printConverters(const char *pname, const char *lookfor, } if (U_FAILURE(err)) { u_wmsg(stderr, "cantGetTag", u_wmsg_errorName(err)); - return -1; + goto error_cleanup; } } if (canon) { @@ -289,7 +291,7 @@ static int printConverters(const char *pname, const char *lookfor, putchar('\t'); u_wmsg(stderr, "cantGetAliases", str.getTerminatedBuffer(), u_wmsg_errorName(err)); - return -1; + goto error_cleanup; } else { uint16_t a, s, t; @@ -303,7 +305,7 @@ static int printConverters(const char *pname, const char *lookfor, putchar('\t'); u_wmsg(stderr, "cantGetAliases", str.getTerminatedBuffer(), u_wmsg_errorName(err)); - return -1; + goto error_cleanup; } /* Print the current alias so that it looks right. */ @@ -361,6 +363,9 @@ static int printConverters(const char *pname, const char *lookfor, /* Success. */ return 0; +error_cleanup: + uprv_free(stds); + return -1; } /* Print all available transliterators. If canon is non zero, print