[bug fix] ECPG: freeing memory for pgtypes crashes on Windows

Поиск
Список
Период
Сортировка
От Tsunakawa, Takayuki
Тема [bug fix] ECPG: freeing memory for pgtypes crashes on Windows
Дата
Msg-id 0A3221C70F24FB45833433255569204D1F8AD5D6@G01JPEXMBYT05
обсуждение исходный текст
Ответы Re: [bug fix] ECPG: freeing memory for pgtypes crashes on Windows
Список pgsql-hackers
Hello,

Some user hit a problem with ECPG on Windows.  The attached patch is a fix for it.  I'd appreciate it if you could
backportthis in all supported versions.
 

The problem is simple.  free() in the following example crashes:

    char *out;

    out = PGTYPESnumeric_to_asc(...);
    free(out);

The cause is the mismatch of the version of C runtime library.  The version of Visual Studio used to build the
applicationwas different from that for building PostgreSQL (libpgtypes.dll).
 

The fix is to add PGTYPES_free() in libpgtypes.dll, just like libpq has PQfreemem() described here:

https://www.postgresql.org/docs/devel/static/libpq-misc.html


Regards
Takayuki Tsunakawa


Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] generated columns
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Wait for parallel workers to attach