From: Howard Chu Date: Wed, 14 Jan 2015 17:47:44 +0000 (+0000) Subject: Minor cleanup (coverity) X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=59ee92213b77f8f8a990933b0500e8c5a9b702b2;p=openldap Minor cleanup (coverity) --- diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index 3fddf27fcf..456c4be655 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -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; } diff --git a/servers/slapd/back-sql/schema-map.c b/servers/slapd/back-sql/schema-map.c index 8ab7eba389..c702dde9a3 100644 --- a/servers/slapd/back-sql/schema-map.c +++ b/servers/slapd/back-sql/schema-map.c @@ -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; } diff --git a/servers/slapd/slapcommon.c b/servers/slapd/slapcommon.c index c76572eccb..7d20fa18f9 100644 --- a/servers/slapd/slapcommon.c +++ b/servers/slapd/slapcommon.c @@ -528,6 +528,7 @@ slap_tool_init( case SLAPCAT: case SLAPSCHEMA: /* dump subtree */ + ch_free( subtree ); subtree = ch_strdup( optarg ); break; }