We don't actually copy...
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 25 Jun 2014 13:06:52 +0000 (14:06 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 25 Jun 2014 13:09:05 +0000 (14:09 +0100)
src/modules/rlm_perl/rlm_perl.c

index f027873..369a17b 100644 (file)
@@ -565,10 +565,6 @@ static void perl_store_vps(UNUSED TALLOC_CTX *ctx, REQUEST *request, VALUE_PAIR
 
        vp_cursor_t cursor;
 
-       /*
-        *      Copy the valuepair list so we can sort it in place
-        *      without messing up anything else.
-        */
        pairsort(&vps, attrtagcmp);
        for (vp = fr_cursor_init(&cursor, &vps);
             vp;
@@ -579,8 +575,6 @@ static void perl_store_vps(UNUSED TALLOC_CTX *ctx, REQUEST *request, VALUE_PAIR
                char namebuf[256];
                char buffer[1024];
 
-               AV *av;
-
                size_t len;
 
                /*
@@ -600,6 +594,8 @@ static void perl_store_vps(UNUSED TALLOC_CTX *ctx, REQUEST *request, VALUE_PAIR
                 *      same type/tag should follow on from each other.
                 */
                if ((next = fr_cursor_next_peek(&cursor)) && ATTRIBUTE_EQ(vp, next)) {
+                       AV *av;
+
                        av = newAV();
                        for (next = fr_cursor_first(&cursor);
                             next;