diff options
author | Nicholas Clark <nick@ccl4.org> | 2004-07-16 08:53:28 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2004-07-16 08:53:28 +0000 |
commit | 8043fdafce9b64db18484779a548e4f4adefc5ed (patch) | |
tree | 6922135d5bed022676c770fc23de22c6967db768 /util.c | |
parent | d94006e83fb3a18ffb59fd5cb41bc7ab9d73a7f6 (diff) | |
download | perl-8043fdafce9b64db18484779a548e4f4adefc5ed.tar.gz |
Some calls to PerlMemShared_alloc() aren't checking the return value.
Bug spotted by Nigel Sandever
p4raw-id: //depot/perl@23121
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -803,6 +803,11 @@ Perl_savesharedpv(pTHX_ const char *pv) register char *newaddr = Nullch; if (pv) { newaddr = (char*)PerlMemShared_malloc(strlen(pv)+1); + if (!newaddr) { + PerlLIO_write(PerlIO_fileno(Perl_error_log), + PL_no_mem, strlen(PL_no_mem)); + my_exit(1); + } (void)strcpy(newaddr,pv); } return newaddr; |