@@ -6503,7 +6503,7 @@ unres_schema_add_str(struct lys_module *mod, struct unres_schema *unres, void *i
65036503 dictstr = lydict_insert (mod -> ctx , str , 0 );
65046504 rc = unres_schema_add_node (mod , unres , item , type , (struct lys_node * )dictstr );
65056505
6506- if (rc == -1 ) {
6506+ if (rc < 0 ) {
65076507 lydict_remove (mod -> ctx , dictstr );
65086508 }
65096509 return rc ;
@@ -6518,7 +6518,8 @@ unres_schema_add_str(struct lys_module *mod, struct unres_schema *unres, void *i
65186518 * @param[in] type Type of the unresolved item. UNRES_TYPE_DER is handled specially!
65196519 * @param[in] snode Schema node argument.
65206520 *
6521- * @return EXIT_SUCCESS on success, EXIT_FIALURE on storing the item in unres, -1 on error.
6521+ * @return EXIT_SUCCESS on success, EXIT_FIALURE on storing the item in unres, -1 on error, -2 if the unres item
6522+ * is already in the unres list.
65226523 */
65236524int
65246525unres_schema_add_node (struct lys_module * mod , struct unres_schema * unres , void * item , enum UNRES_ITEM type ,
@@ -6536,7 +6537,7 @@ unres_schema_add_node(struct lys_module *mod, struct unres_schema *unres, void *
65366537 if (unres -> type [u ] == type && unres -> item [u ] == item &&
65376538 unres -> str_snode [u ] == snode && unres -> module [u ] == mod ) {
65386539 /* duplication, will be resolved later */
6539- return EXIT_FAILURE ;
6540+ return -2 ;
65406541 }
65416542 }
65426543
0 commit comments