summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mg.c b/mg.c
index f79210e5f0..9f3075d655 100644
--- a/mg.c
+++ b/mg.c
@@ -2091,14 +2091,14 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
break;
case '\017': /* ^O */
if (*(mg->mg_ptr+1) == '\0') {
- if (PL_osname)
+ if (PL_osname) {
Safefree(PL_osname);
+ PL_osname = Nullch;
+ }
if (SvOK(sv)) {
TAINT_PROPER("assigning to $^O");
PL_osname = savepv(SvPV(sv,len));
}
- else
- PL_osname = Nullch;
}
else if (strEQ(mg->mg_ptr, "\017PEN")) {
if (!PL_compiling.cop_io)