This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix another CvMUTEXP() leak
authorGurusamy Sarathy <gsar@cpan.org>
Sat, 18 Jul 1998 02:08:01 +0000 (02:08 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Sat, 18 Jul 1998 02:08:01 +0000 (02:08 +0000)
p4raw-id: //depot/perl@1526

gv.c

diff --git a/gv.c b/gv.c
index 505f633..4adce49 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -124,7 +124,8 @@ gv_init(GV *gv, HV *stash, char *name, STRLEN len, int multi)
        CvSTASH(GvCV(gv)) = curstash;
 #ifdef USE_THREADS
        CvOWNER(GvCV(gv)) = 0;
-       New(666, CvMUTEXP(GvCV(gv)), 1, perl_mutex);
+       if (!CvMUTEXP(GvCV(gv)))
+           New(666, CvMUTEXP(GvCV(gv)), 1, perl_mutex);
        MUTEX_INIT(CvMUTEXP(GvCV(gv)));
 #endif /* USE_THREADS */
        if (proto) {