On Thu, Oct 13, 2016 at 1:40 PM, Michael Paquier <michael.paqu...@gmail.com>
wrote:
> I am attaching that to the next CF.

I have tested this patch. Now we error out as OOM instead of crash.
------------------------------------------------
postgres=# SELECT '12.34'::money;
ERROR:  out of memory
LINE 1: SELECT '12.34'::money;
------------------------------------------------

One thing which you might need to reconsider is removal of memory leak
comments. There is still a leak if there is an error while encoding in
db_encoding_strdup.
Unless you want to catch those error with an TRY();....CATCH(); and then
free the mem.

-        * localeconv()'s results.  Note that if we were to fail within this
-        * sequence before reaching "CurrentLocaleConvAllocated = true", we 
could
-        * leak some memory --- but not much, so it's not worth agonizing over.

Rest all LGTM.
-- 
Thanks and Regards
Mithun C Y
EnterpriseDB: http://www.enterprisedb.com

Reply via email to