From 2b3cb54db43dbb757d60cde2d78ee654369818a7 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 21 Jun 2004 21:52:03 +0000 Subject: [PATCH] (casify_object): Use SAFE_ALLOCA. --- src/casefiddle.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; } -- 2.39.2