]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#8731 Remove more unused buffers
authorOndřej Kuzník <ondra@openldap.org>
Tue, 19 Feb 2019 10:24:43 +0000 (10:24 +0000)
committerOndřej Kuzník <ondra@openldap.org>
Tue, 19 Feb 2019 10:24:43 +0000 (10:24 +0000)
servers/slapd/aclparse.c
servers/slapd/back-meta/bind.c
servers/slapd/back-meta/search.c
servers/slapd/back-sql/entry-id.c
servers/slapd/daemon.c

index 2b65b6444c235800df2e9fc3a1c92d5a1d2692e5..fddf057a640aa6a4370f57cec6715852a9a87730 100644 (file)
@@ -526,17 +526,12 @@ parse_acl(
                                                        int e = regcomp( &a->acl_attrval_re, bv.bv_val,
                                                                REG_EXTENDED | REG_ICASE );
                                                        if ( e ) {
-                                                               char    err[SLAP_TEXT_BUFLEN],
-                                                                       buf[ SLAP_TEXT_BUFLEN ];
+                                                               char    err[SLAP_TEXT_BUFLEN];
 
                                                                regerror( e, &a->acl_attrval_re, err, sizeof( err ) );
-
                                                                Debug(LDAP_DEBUG_ANY,
                                                                      "%s: line %d: regular expression \"%s\" bad because of %s\n",
-                                                                     fname,
-                                                                     lineno,
-                                                                     right,
-                                                                     err );
+                                                                     fname, lineno, right, err );
                                                                goto fail;
                                                        }
                                                        a->acl_attrval_style = ACL_STYLE_REGEX;
@@ -672,14 +667,12 @@ parse_acl(
                                        int e = regcomp( &a->acl_dn_re, a->acl_dn_pat.bv_val,
                                                REG_EXTENDED | REG_ICASE );
                                        if ( e ) {
-                                               char    err[ SLAP_TEXT_BUFLEN ],
-                                                       buf[ SLAP_TEXT_BUFLEN ];
+                                               char    err[ SLAP_TEXT_BUFLEN ];
 
                                                regerror( e, &a->acl_dn_re, err, sizeof( err ) );
                                                Debug(LDAP_DEBUG_ANY,
                                                      "%s: line %d: regular expression \"%s\" bad because of %s\n",
-                                                     fname, lineno, right,
-                                                     err );
+                                                     fname, lineno, right, err );
                                                goto fail;
                                        }
                                }
index d62a2faeee6c0e6118757d498e79045efc872f05..c769b9db6c1c1639780eb02576465e784f93ff86 100644 (file)
@@ -308,7 +308,6 @@ meta_back_bind_op_result(
        struct timeval          tv;
        int                     rc;
        int                     nretries = mt->mt_nretries;
-       char                    buf[ SLAP_TEXT_BUFLEN ];
 
        Debug( LDAP_DEBUG_TRACE,
                ">>> %s meta_back_bind_op_result[%d]\n",
@@ -753,15 +752,12 @@ retry_binding:;
                 * in case of failure, it resets mc...
                 */
                if ( rc != LDAP_SUCCESS ) {
-                       char            buf[ SLAP_TEXT_BUFLEN ];
-
                        if ( mc == NULL ) {
                                /* meta_back_single_dobind() already sent 
                                 * response and released connection */
                                goto send_err;
                        }
 
-
                        if ( rc == LDAP_UNAVAILABLE ) {
                                /* FIXME: meta_back_retry() already re-calls
                                 * meta_back_single_dobind() */
index b50a7cac6bad8c3c6258d40c749489dd4d025be3..ee2a73a709daf7ae0887db9488ec37f024250de0 100644 (file)
@@ -102,7 +102,6 @@ meta_search_dobind_init(
                /* already bound (or anonymous) */
 
 #ifdef DEBUG_205
-               char    buf[ SLAP_TEXT_BUFLEN ] = { '\0' };
                int     bound = 0;
 
                if ( LDAP_BACK_CONN_ISBOUND( msc ) ) {
@@ -1374,7 +1373,6 @@ really_bad:;
                                        }
 
                                } else if ( rc == LDAP_RES_SEARCH_RESULT ) {
-                                       char            buf[ SLAP_TEXT_BUFLEN ];
                                        char            **references = NULL;
                                        LDAPControl     **ctrls = NULL;
 
@@ -1499,6 +1497,7 @@ really_bad:;
                                        sres = slap_map_api2result( rs );
        
                                        if ( LogTest( LDAP_DEBUG_TRACE | LDAP_DEBUG_ANY ) ) {
+                                               char buf[ SLAP_TEXT_BUFLEN ];
                                                snprintf( buf, sizeof( buf ),
                                                        "%s meta_back_search[%ld] "
                                                        "match=\"%s\" err=%ld",
index 94cb8b95ffe65f59a625be99a0929ee0d43a3b5e..3b6b4fd63006d6bd8fa69c56632f1ef98cc5de2f 100644 (file)
@@ -264,8 +264,6 @@ backsql_dn2id(
        backsql_BindRowAsStrings_x( sth, &row, op->o_tmpmemctx );
        rc = SQLFetch( sth );
        if ( BACKSQL_SUCCESS( rc ) ) {
-               char    buf[ SLAP_TEXT_BUFLEN ];
-
 #ifdef LDAP_DEBUG
                Debug(LDAP_DEBUG_TRACE,
                      "   backsql_dn2id(\"%s\"): id=%s keyval=%s oc_id=%s dn=%s\n",
index f5e1b55032a6733ee03aead26b66ab4eee0ea680..d64756a2ee7e5370c8ab48b8d93b84bb82599dcd 100644 (file)
@@ -2384,7 +2384,6 @@ slapd_daemon_task(
                if ( 1 ) {
                        int origsize, size, realsize, rc;
                        socklen_t optlen;
-                       char buf[ SLAP_TEXT_BUFLEN ];
 
                        size = 0;
                        if ( slap_listeners[l]->sl_tcp_rmem > 0 ) {