summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-07-16 08:53:28 +0000
committerNicholas Clark <nick@ccl4.org>2004-07-16 08:53:28 +0000
commit8043fdafce9b64db18484779a548e4f4adefc5ed (patch)
tree6922135d5bed022676c770fc23de22c6967db768 /util.c
parentd94006e83fb3a18ffb59fd5cb41bc7ab9d73a7f6 (diff)
downloadperl-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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/util.c b/util.c
index 1892fec3f5..030c70607b 100644
--- a/util.c
+++ b/util.c
@@ -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;