RE: [PATCH] memory leak in ecpglib

Поиск
Список
Период
Сортировка
От kuroda.hayato@fujitsu.com
Тема RE: [PATCH] memory leak in ecpglib
Дата
Msg-id OSAPR01MB20049FB3DB4734A8BC428171F5ED0@OSAPR01MB2004.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответ на RE: [PATCH] memory leak in ecpglib  ("Zhang, Jie" <zhangjie2@cn.fujitsu.com>)
Список pgsql-hackers
Dear Zhang,

# I resend the email

Thank you for reporting a bug. I didn't care about this case.

>> We should free p->cursor_name before p->cursor_name = 
>> ecpg_strdup(cursor_name, lineno).

I'm wondering whether this approach is correct or not.
If your patch is committed, in your example, any operation for cur1 will not be accepted.

My idea is changing ecpg_update_declare_statement() for permitting one-to-many relation between a declared name and
cursors.
An example is as below:

p = ecpg_find_declared_statement(declared_name);
if (p && p->cursor_name == cursor_name)
    p->cursor_name = ecpg_strdup(cursor_name, lineno);

Do you have any suggestions or comments for this?

Best Regards,
Hayato Kuroda
Fujitsu LIMITED

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: check_recovery_target_lsn() does a PG_CATCH without a throw
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: pgbench rate limiting changes transaction latency computation