You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by st...@apache.org on 2004/01/29 03:47:34 UTC
cvs commit: modperl-2.0/src/modules/perl modperl_io_apache.c
stas 2004/01/28 18:47:34
Modified: src/modules/perl modperl_io_apache.c
Log:
avoid a memory leak if flatten() croaks by moving newSV until after croak.
Revision Changes Path
1.15 +2 -1 modperl-2.0/src/modules/perl/modperl_io_apache.c
Index: modperl_io_apache.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_io_apache.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -u -r1.14 -r1.15
--- modperl_io_apache.c 23 Dec 2003 03:02:34 -0000 1.14
+++ modperl_io_apache.c 29 Jan 2004 02:47:34 -0000 1.15
@@ -73,12 +73,13 @@
PerlIOApache_getarg(pTHX_ PerlIO *f, CLONE_PARAMS *param, int flags)
{
PerlIOApache *st = PerlIOSelf(f, PerlIOApache);
- SV *sv = newSV(0);
+ SV *sv;
if (!st->r) {
Perl_croak(aTHX_ "an attempt to getarg from a stale io handle");
}
+ sv = newSV(0);
sv_setref_pv(sv, "Apache::RequestRec", (void*)(st->r));
MP_TRACE_o(MP_FUNC, "retrieved request_rec obj: 0x%lx", st->r);