diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-10-27 21:40:40 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-10-27 21:40:40 +0000 |
commit | 4243c432ee3fbfe1fc81b006c97c0de452702db0 (patch) | |
tree | 578338eea6c003d08d723fba822a4980492e80d0 /mg.c | |
parent | 267d554123ae974ccd717e77510a6c3e0691dab2 (diff) | |
download | perl-4243c432ee3fbfe1fc81b006c97c0de452702db0.tar.gz |
Change 27779 failed to free() memory in two places in Perl_magic_set(),
and hence was leaking like the proverbial Jumblie maritime craft.
p4raw-id: //depot/perl@29127
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -2304,11 +2304,16 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) accumulate |= ptr[i] ; any_fatals |= (ptr[i] & 0xAA) ; } - if (!accumulate) - PL_compiling.cop_warnings = pWARN_NONE; + if (!accumulate) { + if (!specialWARN(PL_compiling.cop_warnings)) + PerlMemShared_free(PL_compiling.cop_warnings); + PL_compiling.cop_warnings = pWARN_NONE; + } /* Yuck. I can't see how to abstract this: */ else if (isWARN_on(((STRLEN *)SvPV_nolen_const(sv)) - 1, WARN_ALL) && !any_fatals) { + if (!specialWARN(PL_compiling.cop_warnings)) + PerlMemShared_free(PL_compiling.cop_warnings); PL_compiling.cop_warnings = pWARN_ALL; PL_dowarn |= G_WARN_ONCE ; } |