summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/scope.c b/scope.c
index 7619c2b808..5ad043cdc1 100644
--- a/scope.c
+++ b/scope.c
@@ -152,7 +152,7 @@ GV *gv;
GP *ogp = GvGP(gv);
SSCHECK(3);
- SSPUSHPTR(gv);
+ SSPUSHPTR(SvREFCNT_inc(gv));
SSPUSHPTR(ogp);
SSPUSHINT(SAVEt_GP);
@@ -525,6 +525,7 @@ I32 base;
gv = (GV*)SSPOPPTR;
gp_free(gv);
GvGP(gv) = (GP*)ptr;
+ SvREFCNT_dec(gv);
break;
case SAVEt_FREESV:
ptr = SSPOPPTR;