From: Vincent Pit Date: Wed, 4 Nov 2015 18:10:40 +0000 (-0200) Subject: Stop leaking the underlying re::engine::Plugin object X-Git-Tag: v0.11~7 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=908271b6e3cd68ae73cbd007d021af2670ed0558;p=perl%2Fmodules%2Fre-engine-Plugin.git Stop leaking the underlying re::engine::Plugin object --- diff --git a/Plugin.xs b/Plugin.xs index af917b7..da33ce2 100644 --- a/Plugin.xs +++ b/Plugin.xs @@ -209,7 +209,6 @@ Plugin_comp(pTHX_ const SV * const pattern, const U32 flags) /* Our blessed object */ obj = newSV(0); - SvREFCNT_inc_simple_void_NN(obj); Newxz(re, 1, struct replug); sv_setref_pv(obj, XSH_PACKAGE, (void *) re); @@ -378,8 +377,11 @@ Plugin_free(pTHX_ REGEXP * const RX) SvREFCNT_dec(self->cb_num_capture_buff_LENGTH); self->rx = NULL; + Safefree(self); + SvREFCNT_dec(rx->pprivate); + /* dSP; SV *callback;