diff options
-rw-r--r-- | ldap/servers/slapd/mapping_tree.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ldap/servers/slapd/mapping_tree.c b/ldap/servers/slapd/mapping_tree.c index 77a21bf4..eccfe4ea 100644 --- a/ldap/servers/slapd/mapping_tree.c +++ b/ldap/servers/slapd/mapping_tree.c @@ -1375,7 +1375,7 @@ int mapping_tree_entry_modify_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefor int mapping_tree_entry_add_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg) { - mapping_tree_node *node; + mapping_tree_node *node = NULL; int i; backend * be; @@ -1387,12 +1387,12 @@ int mapping_tree_entry_add_callback(Slapi_PBlock *pb, Slapi_Entry* entryBefore, * be checked again */ *returncode = mapping_tree_entry_add(entryBefore, &node); - if (LDAP_SUCCESS != *returncode) + if (LDAP_SUCCESS != *returncode || !node) { return SLAPI_DSE_CALLBACK_ERROR; } - if(node && node->mtn_parent != NULL && node != mapping_tree_root ) + if(node->mtn_parent != NULL && node != mapping_tree_root ) { /* If the node has a parent and the node is not the mapping tree root, * then add it as a child node. Note that the special case when the @@ -1433,7 +1433,7 @@ static void mtn_remove_node(mapping_tree_node * node) PR_ASSERT(tmp_node != NULL); - tmp_node->mtn_brother = node->mtn_brother; + if (tmp_node) tmp_node->mtn_brother = node->mtn_brother; } node->mtn_brother = NULL; } |