ecpg: Fix error handling on OOMs when parsing timestamps

Michael Paquier <michael@paquier.xyz>

Commit: 0a9118ccc0eb2e6a31201b2443a2eb1078e34894
Author: Michael Paquier <michael@paquier.xyz>
Date: 2024-02-19T00:05:51Z
Releases: 17.0
ecpg: Fix error handling on OOMs when parsing timestamps

pgtypes_alloc() can return NULL when failing an allocation, which is
something that PGTYPEStimestamp_defmt_asc() has forgotten about when
translating a timestamp for 'D', 'r', 'R' and 'T' as these require a
temporary allocation.

This is unlikely going to be a problem in practice, so no backpatch is
done.

Author: Oleg Tselebrovskiy
Discussion: https://postgr.es/m/bf47888585149f83b276861a1662f7e4@postgrespro.ru

Files

PathChange+/−
src/interfaces/ecpg/pgtypeslib/dt_common.c modified +8 −0

Discussion