diff options
author | Russ Allbery <eagle@eyrie.org> | 2013-12-11 19:18:04 -0800 |
---|---|---|
committer | Russ Allbery <eagle@eyrie.org> | 2013-12-11 19:18:04 -0800 |
commit | db8cb7c101f9665e6dc2e63a9d2ef0582670c4f4 (patch) | |
tree | de631b93efaef4f8d44a5907325c9b35d6b44ba9 | |
parent | d25926ce187353b6a0df67e0fa49e416d715ca25 (diff) |
Correctly handle memory errors in parsing ad_instances
-rw-r--r-- | plugin/general.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugin/general.c b/plugin/general.c index 1639ddc..23b7939 100644 --- a/plugin/general.c +++ b/plugin/general.c @@ -39,6 +39,7 @@ krb5_error_code sync_init(krb5_context ctx, kadm5_hook_modinfo **result) { kadm5_hook_modinfo *config; + krb5_error_code code; /* Allocate our internal data. */ config = calloc(1, sizeof(*config)); @@ -53,7 +54,11 @@ sync_init(krb5_context ctx, kadm5_hook_modinfo **result) sync_config_string(ctx, "ad_ldap_base", &config->ad_ldap_base); /* Get allowed instances from krb5.conf. */ - sync_config_list(ctx, "ad_instances", &config->ad_instances); + code = sync_config_list(ctx, "ad_instances", &config->ad_instances); + if (code != 0) { + sync_close(ctx, config); + return code; + } /* See if we're propagating an instance to the base account in AD. */ sync_config_string(ctx, "ad_base_instance", &config->ad_base_instance); |