Instead of aborting when an incomplete xpath is given to the
nb_oper_data_iterate() function, just return an error so that the
callers have a chance to treat this error. Aborting based on invalid
user input is never the right thing to do.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
n++;
}
list_keys.num = n;
- assert(list_keys.num
- == ((struct lys_node_list *)dn->schema)->keys_size);
+ if (list_keys.num
+ != ((struct lys_node_list *)dn->schema)->keys_size) {
+ list_delete(&list_dnodes);
+ yang_dnode_free(dnode);
+ return NB_ERR_NOT_FOUND;
+ }
/* Find the list entry pointer. */
nn = dn->schema->priv;