Re: [bug fix] ECPG: freeing memory for pgtypes crashes on Windows
Thomas Munro <thomas.munro@enterprisedb.com>
From: Thomas Munro <thomas.munro@enterprisedb.com>
To: "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, "Michael Meskes (meskes@postgresql.org)" <meskes@postgresql.org>
Date: 2018-02-04T22:17:11Z
Lists: pgsql-hackers
On Fri, Feb 2, 2018 at 3:47 PM, Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com> wrote: > The fix is to add PGTYPES_free() in libpgtypes.dll, just like libpq has PQfreemem() described here: +#ifndef PGTYPES_FREE +#define PGTYPES_FREE + extern void PGTYPES_free(void *ptr); +#endif It seems quite strange to repeat this in pgtypes_date.h, pgtypes_interval.h and pgtypes_numeric.h. I guess you might not want to introduce a new common header file so that his can be back-patched more easily? Not sure if there is a project policy about that, but it seems unfortunate to introduce maintenance burden by duplicating this. + <function>PGTYPES_free()/<function> instead of <function>free()</function>. The "/" needs to move inside then closing tag. -- Thomas Munro http://www.enterprisedb.com
Commits
-
Add PGTYPESchar_free() to avoid cross-module problems on Windows.
- edabd8f5a424 9.3.24 landed
- db05d0b906be 9.4.19 landed
- 3bc19d0d263c 9.5.14 landed
- b5b973ef0ba7 9.6.10 landed
- 3566873f2190 10.5 landed
- 4c8156d87108 11.0 landed