]> git.sur5r.net Git - openldap/commitdiff
fix memory handling in rewrite parsing (ITS#6526)
authorPierangelo Masarati <ando@openldap.org>
Sat, 17 Apr 2010 16:29:34 +0000 (16:29 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 17 Apr 2010 16:29:34 +0000 (16:29 +0000)
servers/slapd/overlays/rwm.c

index 603275ff7014bb713efdf0384a8c54211c82a8db..1c1acc819b46dfa6798c7ac1d1883a0039486f86 100644 (file)
@@ -2114,7 +2114,6 @@ rwm_cf_gen( ConfigArgs *c )
                switch ( c->type ) {
                case RWM_CF_REWRITE:
                        if ( c->valx >= 0 ) {
-                               ConfigArgs ca = { 0 };
                                int i;
 
                                for ( i = 0; !BER_BVISNULL( &rwmap->rwm_bva_rewrite[ i ] ); i++ )
@@ -2139,6 +2138,8 @@ rwm_cf_gen( ConfigArgs *c )
 
                                for ( i = 0; !BER_BVISNULL( &rwmap->rwm_bva_rewrite[ i ] ); i++ )
                                {
+                                       ConfigArgs ca = { 0 };
+
                                        ca.line = rwmap->rwm_bva_rewrite[ i ].bv_val;
                                        ca.argc = 0;
                                        config_fp_parse_line( &ca );
@@ -2282,7 +2283,6 @@ rwm_cf_gen( ConfigArgs *c )
        case RWM_CF_REWRITE:
                if ( c->valx >= 0 ) {
                        struct rewrite_info *rwm_rw = rwmap->rwm_rw;
-                       ConfigArgs ca = { 0 };
                        int i, last;
 
                        for ( last = 0; rwmap->rwm_bva_rewrite && !BER_BVISNULL( &rwmap->rwm_bva_rewrite[ last ] ); last++ )
@@ -2296,6 +2296,8 @@ rwm_cf_gen( ConfigArgs *c )
                        rc = rwm_info_init( &rwmap->rwm_rw );
 
                        for ( i = 0; i < c->valx; i++ ) {
+                               ConfigArgs ca = { 0 };
+
                                ca.line = rwmap->rwm_bva_rewrite[ i ].bv_val;
                                ca.argc = 0;
                                config_fp_parse_line( &ca );
@@ -2344,6 +2346,8 @@ rwm_cf_gen( ConfigArgs *c )
 
                        for ( i = c->valx; rwmap->rwm_bva_rewrite && !BER_BVISNULL( &rwmap->rwm_bva_rewrite[ i ] ); i++ )
                        {
+                               ConfigArgs ca = { 0 };
+
                                ca.line = rwmap->rwm_bva_rewrite[ i ].bv_val;
                                ca.argc = 0;
                                config_fp_parse_line( &ca );