Fix a couple of typos.
[p5sagit/p5-mst-13.2.git] / regcomp.c
index 97e81bc..7b4d647 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -4967,6 +4967,7 @@ Perl_pregfree(pTHX_ struct regexp *r)
        int n = r->data->count;
        PAD* new_comppad = NULL;
        PAD* old_comppad;
+       PADOFFSET refcnt;
 
        while (--n >= 0) {
           /* If you add a ->what type here, update the comment in regcomp.h */
@@ -4989,13 +4990,10 @@ Perl_pregfree(pTHX_ struct regexp *r)
                                new_comppad : Null(PAD *)
                );
                OP_REFCNT_LOCK;
-               if (!OpREFCNT_dec((OP_4tree*)r->data->data[n])) {
-                   OP_REFCNT_UNLOCK;
+               refcnt = OpREFCNT_dec((OP_4tree*)r->data->data[n]);
+               OP_REFCNT_UNLOCK;
+               if (!refcnt)
                     op_free((OP_4tree*)r->data->data[n]);
-               }
-               else {
-                   OP_REFCNT_UNLOCK;
-               }
 
                PAD_RESTORE_LOCAL(old_comppad);
                SvREFCNT_dec((SV*)new_comppad);