From: Gurusamy Sarathy Date: Tue, 17 Mar 1998 14:02:51 +0000 (+0000) Subject: [asperl] fix buggy order of free() in regcomp.c (from AS) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a193d65404eecbf16bac86932344f43dcfdbcecd;p=p5sagit%2Fp5-mst-13.2.git [asperl] fix buggy order of free() in regcomp.c (from AS) p4raw-id: //depot/asperl@831 --- diff --git a/regcomp.c b/regcomp.c index aba1f9a..6758ef3 100644 --- a/regcomp.c +++ b/regcomp.c @@ -2551,12 +2551,13 @@ pregfree(struct regexp *r) Safefree(r->precomp); if (r->subbase) Safefree(r->subbase); - if (r->substrs) + if (r->substrs) { + if (r->anchored_substr) + SvREFCNT_dec(r->anchored_substr); + if (r->float_substr) + SvREFCNT_dec(r->float_substr); Safefree(r->substrs); - if (r->anchored_substr) - SvREFCNT_dec(r->anchored_substr); - if (r->float_substr) - SvREFCNT_dec(r->float_substr); + } if (r->data) { int n = r->data->count; while (--n >= 0) {