This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Out of memory message should not allocate memory.
authorCraig A. Berry <craigberry@mac.com>
Mon, 3 Sep 2012 02:30:55 +0000 (21:30 -0500)
committerCraig A. Berry <craigberry@mac.com>
Sat, 8 Sep 2012 22:56:33 +0000 (17:56 -0500)
commit7cd83f6573da7fd1101fc83cb13867d52fea3d41
tree0819e025ba32687483a140809a55e5caecf31ac2
parent5eabab158821032728b40b21aab4353b1213e250
Out of memory message should not allocate memory.

This fixes [perl #40595].  When Perl_malloc reports an out of
memory error, it should not make calls to PerlIO functions that
may turn around and allocate memory using Perl_malloc.  A simple
write() should be ok, though.  Inspired by S_write_no_mem() from
util.c.  Also replaces the local write2 function, which did the
same thing slightly differently.

Under -DDEBUGGING, there are other calls to PerlIO_printf that are
also likely unsafe, but that problem is not addressed here.
malloc.c