/* add a new path component */
-WERROR pathtree_add(struct sorted_tree *tree, const char *path, void *data_p );
+bool pathtree_add(struct sorted_tree *tree, const char *path, void *data_p );
/* search path */
Add a new node into the tree given a key path and a blob of data
*************************************************************************/
-WERROR pathtree_add(struct sorted_tree *tree, const char *path, void *data_p)
+bool pathtree_add(struct sorted_tree *tree, const char *path, void *data_p)
{
char *str, *base, *path2;
struct tree_node *current, *next;
- WERROR ret = WERR_OK;
+ bool ret = true;
DEBUG(8,("pathtree_add: Enter\n"));
next = pathtree_birth_child( current, base );
if ( !next ) {
DEBUG(0,("pathtree_add: Failed to create new child!\n"));
- ret = WERR_NOMEM;
+ ret = false;
goto done;
}
}
DEBUG(10, ("reghook_cache_add: Adding ops %p for key [%s]\n",
(void *)ops, key));
- werr = pathtree_add(cache_tree, key, ops);
+ if (!pathtree_add(cache_tree, key, ops))
+ werr = WERR_NOMEM;
+ else
+ werr = WERR_OK;
done:
TALLOC_FREE(key);