]> git.sur5r.net Git - openldap/commitdiff
Minor cleanup (coverity)
authorHoward Chu <hyc@symas.com>
Sun, 18 Jan 2015 15:15:50 +0000 (15:15 +0000)
committerHoward Chu <hyc@symas.com>
Sun, 18 Jan 2015 15:15:50 +0000 (15:15 +0000)
servers/slapd/back-meta/search.c
servers/slapd/config.c

index a20e941748be0fcd604b6926c69c46fb26bb4bff..456c4be65599087c0ac3a93e7ebad7a4a1ae1dd4 100644 (file)
@@ -1627,8 +1627,6 @@ err_pr:;
                                                                }
                                                        }
 #endif /* SLAPD_META_CLIENT_PR */
-
-                                                       ldap_controls_free( ctrls );
                                                }
                                                /* fallthru */
 
@@ -1650,6 +1648,7 @@ err_pr:;
                                                        || META_BACK_ONERR_STOP( mi ) )
                                                {
                                                        const char *save_text = rs->sr_text;
+got_err:
                                                        savepriv = op->o_private;
                                                        op->o_private = (void *)i;
                                                        rs->sr_text = candidates[ i ].sr_text;
@@ -1658,27 +1657,19 @@ err_pr:;
                                                        op->o_private = savepriv;
                                                        ldap_msgfree( res );
                                                        res = NULL;
+                                                       ldap_controls_free( ctrls );
                                                        goto finish;
                                                }
                                                break;
        
                                        default:
                                                candidates[ i ].sr_err = rs->sr_err;
-                                               if ( META_BACK_ONERR_STOP( mi ) ) {
-                                                       const char *save_text = rs->sr_text;
-                                                       savepriv = op->o_private;
-                                                       op->o_private = (void *)i;
-                                                       rs->sr_text = candidates[ i ].sr_text;
-                                                       send_ldap_result( op, rs );
-                                                       rs->sr_text = save_text;
-                                                       op->o_private = savepriv;
-                                                       ldap_msgfree( res );
-                                                       res = NULL;
-                                                       goto finish;
-                                               }
+                                               if ( META_BACK_ONERR_STOP( mi ) )
+                                                       goto got_err;
                                                break;
                                        }
        
+                                       ldap_controls_free( ctrls );
                                        last = i;
                                        rc = 0;
        
index 8c95822d4eb09bbbad4bbf2557724ad2c6206433..fe89c1b7273f84c09f8cf3c3e1e253b675f664bd 100644 (file)
@@ -2010,7 +2010,7 @@ slap_client_connect( LDAP **ldp, slap_bindconf *sb )
                        "slap_client_connect: "
                        "URI=%s TLS context initialization failed (%d)\n",
                        sb->sb_uri.bv_val, rc, 0 );
-               return rc;
+               goto done;
        }
 #endif