Re: pgsql: Remove unnecessary casts in free() and pfree()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql: Remove unnecessary casts in free() and pfree()
Дата
Msg-id 2342337.1661611779@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pgsql: Remove unnecessary casts in free() and pfree()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-committers
I wrote:
> Justin Pryzby <pryzby@telsasoft.com> writes:
>> This seems to be breaking cfbot's "warnings" test.

> Hmm, well, casting away const is certainly not within pfree's remit,
> so I'm glad we changed this.

Oh, I see: sepgsql's quote_object_name() is doing

    const char *temp;

    temp = quote_identifier(src1);
    appendStringInfoString(&result, temp);
    if (src1 != temp)
        pfree(temp);

evidently because whoever wrote this felt a compulsion to override
quote_identifier's judgment that possibly leaking the quoted identifier
wasn't worth worrying about.  I think we should just nuke this code
altogether and write

    appendStringInfoString(&result, quote_identifier(src1));

            regards, tom lane



В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pgsql: Remove unnecessary casts in free() and pfree()
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Repair rare failure of MULTIEXPR_SUBLINK subplans in inherited u