From: Kim F. Storm Date: Mon, 21 Jun 2004 21:52:03 +0000 (+0000) Subject: (casify_object): Use SAFE_ALLOCA. X-Git-Tag: ttn-vms-21-2-B4~5691 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2b3cb54db43dbb757d60cde2d78ee654369818a7;p=emacs.git (casify_object): Use SAFE_ALLOCA. --- diff --git a/src/casefiddle.c b/src/casefiddle.c index 4672bd317b9..25a5a3d12b8 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c @@ -110,8 +110,12 @@ casify_object (flag, obj) /* The work is not yet finished because of a multibyte character just encountered. */ int fromlen, j_byte = i; - char *buf - = (char *) alloca ((len - i) * MAX_MULTIBYTE_LENGTH + i); + char *buf; + int bufsize; + USE_SAFE_ALLOCA; + + bufsize = (len - i) * MAX_MULTIBYTE_LENGTH + i; + SAFE_ALLOCA (buf, char *, bufsize); /* Copy data already handled. */ bcopy (SDATA (obj), buf, i); @@ -133,6 +137,7 @@ casify_object (flag, obj) } obj = make_multibyte_string (buf, SCHARS (obj), j_byte); + SAFE_FREE (bufsize); } return obj; }