[EMAIL PROTECTED] wrote:
stas 2004/01/28 18:44:33

  Modified:    xs/APR/Brigade APR__Brigade.h
  Log:
  avoid a memory leak if flatten() croaks by moving newSV until after croak.

Watch out for the clear and hidden behind macros croak calls after perl vars were created w/o being made mortal. If the function croaks we get a memory leak. So either move the creation after the croak, or make the variable mortal before the croak.


I think we still have several places that have this problem (probably most are my fault).

- SV *data = newSV(0);
+ SV *data;
mpxs_usage_va_1(bb, "$bb->flatten([$length])");
@@ -125,6 +125,7 @@
length = (apr_size_t)actual;
}
+ data = newSV(0);
mpxs_sv_grow(data, length);

__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to