X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=binutils%2Fwinduni.c;h=4a6231afdc9b02aaee3cf769d754b6b26c9e844e;hb=128e85e3ab36b8e30f6612fb50de3cbb4ede6824;hp=b0b729ec836286937d59fb9a924c352f06c012d5;hpb=4b95cf5c0c75d6efc1b2f96af72317aecca079f1;p=deliverable%2Fbinutils-gdb.git diff --git a/binutils/winduni.c b/binutils/winduni.c index b0b729ec83..4a6231afdc 100644 --- a/binutils/winduni.c +++ b/binutils/winduni.c @@ -1,5 +1,5 @@ /* winduni.c -- unicode support for the windres program. - Copyright (C) 1997-2014 Free Software Foundation, Inc. + Copyright (C) 1997-2016 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. Rewritten by Kai Tietz, Onevision. @@ -213,7 +213,7 @@ unicode_from_ascii_len (rc_uint_type *length, unichar **unicode, const char *asc } /* Make sure we have zero terminated string. */ - p = tmp = (char *) alloca (a_length + 1); + p = tmp = (char *) xmalloc (a_length + 1); memcpy (tmp, ascii, a_length); tmp[a_length] = 0; @@ -279,6 +279,8 @@ unicode_from_ascii_len (rc_uint_type *length, unichar **unicode, const char *asc if (length) *length = idx; + + free (tmp); } /* Convert an unicode string to an ASCII string. We just copy it,