develooper Front page | perl.perl5.porters | Postings from June 2008

Re: [perl #54934] Attempt to free unreferenced scalar fiddling with the symbol table

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
June 8, 2008 07:02
Subject:
Re: [perl #54934] Attempt to free unreferenced scalar fiddling with the symbol table
Message ID:
b77c1dce0806080701u52e33d30mcbeff1f2af815698@mail.gmail.com
2008/5/30 Rafael Garcia-Suarez <rgarciasuarez@gmail.com>:
> Good catch. I've traced the double-freed scalar; the patch below fixes
> the error. However I'm not sure at all it creates no leak.

I've now applied this and bumped the version of PerlIO::via, so this
bug can be closed:

Change 34025 by rgs@scipion on 2008/06/08 14:00:59

        Fix for bug [perl #54934] Attempt to free unreferenced scalar
fiddling with the symbol table
        Keep the refcount of the globs generated by PerlIO::via balanced.

Affected files ...

... //depot/perl/ext/PerlIO/via/via.pm#9 edit
... //depot/perl/ext/PerlIO/via/via.xs#17 edit

Differences ...

==== //depot/perl/ext/PerlIO/via/via.pm#9 (text) ====

@@ -1,5 +1,5 @@
 package PerlIO::via;
-our $VERSION = '0.05';
+our $VERSION = '0.06';
 use XSLoader ();
 XSLoader::load 'PerlIO::via';
 1;

==== //depot/perl/ext/PerlIO/via/via.xs#17 (text) ====

@@ -89,7 +89,7 @@
            if (!s->fh) {
                GV *gv = newGVgen(HvNAME_get(s->stash));
                GvIOp(gv) = newIO();
-               s->fh = newRV_noinc((SV *) gv);
+               s->fh = newRV((SV *) gv);
                s->io = GvIOp(gv);
            }
            IoIFP(s->io) = PerlIONext(f);

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About