diff options
Diffstat (limited to 'daemons')
6 files changed, 22 insertions, 12 deletions
diff --git a/daemons/ipa-sam/ipa_sam.c b/daemons/ipa-sam/ipa_sam.c index ab642d756..b1592b71f 100644 --- a/daemons/ipa-sam/ipa_sam.c +++ b/daemons/ipa-sam/ipa_sam.c @@ -1525,7 +1525,7 @@ static int set_cross_realm_pw(struct ldapsam_privates *ldap_state, krb5_error_code krberr; krb5_context krbctx; krb5_principal service_princ; - struct keys_container keys; + struct keys_container keys = {0, NULL}; char *err_msg; struct berval *reqdata = NULL; struct berval *retdata = NULL; diff --git a/daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap.c b/daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap.c index d7a59d512..54d44ebf6 100644 --- a/daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap.c +++ b/daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap.c @@ -124,13 +124,15 @@ static int ipa_cldap_init_service(Slapi_PBlock *pb, slapi_pblock_get(pb, SLAPI_PLUGIN_CONFIG_ENTRY, &e); if (!e) { LOG_FATAL("Plugin configuration not found!\n"); - return -1; + ret = -1; + goto done; } ctx->base_dn = slapi_entry_attr_get_charptr(e, "nsslapd-basedn"); if (!ctx->base_dn) { LOG_FATAL("Plugin configuration not found!\n"); - return -1; + ret = -1; + goto done; } /* create a stop pipe so the main DS thread can interrupt the poll() diff --git a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c index f48bead04..47d4d68d1 100644 --- a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c +++ b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_common.c @@ -137,10 +137,12 @@ int parse_request_data(struct berval *req_val, struct extdom_req **_req) break; default: ber_free(ber, 1); + free(req); return LDAP_PROTOCOL_ERROR; } ber_free(ber, 1); if (tag == LBER_ERROR) { + free(req); return LDAP_PROTOCOL_ERROR; } @@ -284,11 +286,6 @@ static int get_domain_info(struct ipa_extdom_ctx *ctx, const char *domain_name, domain_info->flat_name = slapi_entry_attr_get_charptr(e[0], "ipaNTFlatName"); - /* TODO: read range from LDAP server */ -/* - range.min = 200000; - range.max = 400000; -*/ ret = set_domain_range(ctx, domain_info->sid, &range); if (ret != 0) { goto done; @@ -313,6 +310,11 @@ done: slapi_free_search_results_internal(pb); slapi_pblock_destroy(pb); free(filter); + + if (ret != 0) { + free_domain_info(domain_info); + } + return ret; } diff --git a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_extop.c b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_extop.c index d5a2f604c..f36878c37 100644 --- a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_extop.c +++ b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_extop.c @@ -170,13 +170,15 @@ static int ipa_extdom_init_ctx(Slapi_PBlock *pb, struct ipa_extdom_ctx **_ctx) slapi_pblock_get(pb, SLAPI_PLUGIN_CONFIG_ENTRY, &e); if (!e) { LOG_FATAL("Plugin configuration not found!\n"); - return -1; + ret = -1; + goto done; } ctx->base_dn = slapi_entry_attr_get_charptr(e, "nsslapd-basedn"); if (!ctx->base_dn) { LOG_FATAL("Base DN not found in plugin configuration not found!\n"); - return -1; + ret = -1; + goto done; } diff --git a/daemons/ipa-slapi-plugins/ipa-range-check/ipa_range_check.c b/daemons/ipa-slapi-plugins/ipa-range-check/ipa_range_check.c index 499e54a9c..82479bec8 100644 --- a/daemons/ipa-slapi-plugins/ipa-range-check/ipa_range_check.c +++ b/daemons/ipa-slapi-plugins/ipa-range-check/ipa_range_check.c @@ -90,7 +90,8 @@ static int slapi_entry_to_range_info(struct slapi_entry *entry, range->name = slapi_entry_attr_get_charptr(entry, IPA_CN); if (range->name == NULL) { - return EINVAL; + ret = EINVAL; + goto done; } ul_val = slapi_entry_attr_get_ulong(entry, IPA_BASE_ID); diff --git a/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_task.c b/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_task.c index ffbc9c636..9e474e83d 100644 --- a/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_task.c +++ b/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_task.c @@ -71,7 +71,10 @@ static const char *fetch_attr(Slapi_Entry *e, const char *attrname, if (slapi_entry_attr_find(e, attrname, &attr) != 0) return default_val; - slapi_attr_first_value(attr, &val); + + if (slapi_attr_first_value(attr, &val) == -1) + return default_val; + return slapi_value_get_string(val); } |