diff options
author | Ludwig Krispenz <lkrispen@redhat.com> | 2015-06-16 11:14:37 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2015-06-29 17:17:29 +0200 |
commit | 5e92c981b0e433ee28b953d222a1b531b525ff1c (patch) | |
tree | 81ee77a1d70e7fe2942ce8415f7346e523cb2d99 /daemons/ipa-slapi-plugins | |
parent | 4d7b630992da3d0c646b27268a85e6e8c30eebfe (diff) | |
download | freeipa-5e92c981b0e433ee28b953d222a1b531b525ff1c.tar.gz freeipa-5e92c981b0e433ee28b953d222a1b531b525ff1c.tar.xz freeipa-5e92c981b0e433ee28b953d222a1b531b525ff1c.zip |
fix coverity issues
Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'daemons/ipa-slapi-plugins')
-rw-r--r-- | daemons/ipa-slapi-plugins/topology/topology_util.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/daemons/ipa-slapi-plugins/topology/topology_util.c b/daemons/ipa-slapi-plugins/topology/topology_util.c index 9851df059..a56704f51 100644 --- a/daemons/ipa-slapi-plugins/topology/topology_util.c +++ b/daemons/ipa-slapi-plugins/topology/topology_util.c @@ -192,7 +192,11 @@ ipa_topo_util_get_replica_conf(char *repl_root) slapi_free_search_results_internal(pb); slapi_pblock_destroy(pb); - if (0 != ipa_topo_cfg_replica_add(topoRepl)) { + if (0 == topoRepl) { + slapi_log_error(SLAPI_LOG_FATAL, IPA_TOPO_PLUGIN_SUBSYSTEM, + "ipa_topo_util_get_replica_conf: " + "cannot create replica\n"); + } else if (0 != ipa_topo_cfg_replica_add(topoRepl)) { slapi_log_error(SLAPI_LOG_FATAL, IPA_TOPO_PLUGIN_SUBSYSTEM, "ipa_topo_util_get_replica_conf: " "replica already exists\n"); @@ -1325,6 +1329,14 @@ ipa_topo_util_delete_segments_for_host(char *repl_root, char *delhost) TopoReplica *tconf = ipa_topo_cfg_replica_find(repl_root, 1); int check_reverse = 1; + if (NULL == tconf) { + slapi_log_error(SLAPI_LOG_PLUGIN, IPA_TOPO_PLUGIN_SUBSYSTEM, + "ipa_topo_util_delete_segments_for_host: " + "failed to get replica object for suffix: %s \n", + repl_root); + return; + } + /* first check if a segment originating at localhost exists */ segm = ipa_topo_cfg_segment_find(repl_root, ipa_topo_get_plugin_hostname(), delhost, SEGMENT_LEFT_RIGHT); |