possible repalloc() in icu_convert_case() - Mailing list pgsql-hackers

From Anton Voloshin
Subject possible repalloc() in icu_convert_case()
Date
Msg-id f21e4ba9-8db8-91bf-067a-fcacb429ac55@postgrespro.ru
Whole thread Raw
Responses Re: possible repalloc() in icu_convert_case()
List pgsql-hackers
Hello,

in src/backend/utils/adt/formatting.c, in icu_convert_case() I see:
     if (status == U_BUFFER_OVERFLOW_ERROR)
     {
         /* try again with adjusted length */
         pfree(*buff_dest);
         *buff_dest = palloc(len_dest * sizeof(**buff_dest));
         ...

Is there any reason why this should not be repalloc()?

In case it should be, I've attached a corresponding patch.

-- 
Anton Voloshin
Postgres Professional: https://www.postgrespro.com
Russian Postgres Company

Attachment

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: ALTER TABLE ADD COLUMN fast default
Next
From: Zhihong Yu
Date:
Subject: Re: Unused variable found in AttrDefaultFetch