]> git.sur5r.net Git - openldap/commitdiff
Minor cleanup (coverity)
authorHoward Chu <hyc@openldap.org>
Wed, 14 Jan 2015 17:47:44 +0000 (17:47 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 14 Jan 2015 17:52:22 +0000 (17:52 +0000)
servers/slapd/back-meta/search.c
servers/slapd/back-sql/schema-map.c
servers/slapd/slapcommon.c

index 3fddf27fcfadfb96f293105f4a8978ddd0516321..456c4be65599087c0ac3a93e7ebad7a4a1ae1dd4 100644 (file)
@@ -1648,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;
@@ -1656,24 +1657,15 @@ 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;
                                        }
        
index 8ab7eba3897fb107ab202d99579569140fd1a1e1..c702dde9a32c82b8ea0d72bc530b603198d14204 100644 (file)
@@ -622,6 +622,7 @@ backsql_load_schema_map( backsql_info *bi, SQLHDBC dbh )
                        Debug( LDAP_DEBUG_TRACE, "backsql_load_schema_map(): "
                                "unable to parse id=\"%s\"\n", 
                                oc_row.cols[ 0 ], 0, 0 );
+                       ch_free( oc_map );
                        return LDAP_OTHER;
                }
 
index c76572eccb380dc0c65f3e95460bd59baef99564..7d20fa18f91e8b71e0f129e79ef4b976f39336b1 100644 (file)
@@ -528,6 +528,7 @@ slap_tool_init(
                        case SLAPCAT:
                        case SLAPSCHEMA:
                                /* dump subtree */
+                               ch_free( subtree );
                                subtree = ch_strdup( optarg );
                                break;
                        }