[asperl] fix buggy order of free() in regcomp.c (from AS)
Gurusamy Sarathy [Tue, 17 Mar 1998 14:02:51 +0000 (14:02 +0000)]
p4raw-id: //depot/asperl@831

regcomp.c

index aba1f9a..6758ef3 100644 (file)
--- 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) {