libyang BUGFIX return value checking
diff --git a/src/validation.c b/src/validation.c
index c16928d..e06df09 100644
--- a/src/validation.c
+++ b/src/validation.c
@@ -689,7 +689,8 @@
     LY_CHECK_RET(ly_set_new(&set));
     LY_LIST_FOR(first, diter) {
         if (diter->schema == snode) {
-            LY_CHECK_RET(ly_set_add(set, (void *)diter, LY_SET_OPT_USEASLIST, NULL));
+            ret = ly_set_add(set, (void *)diter, LY_SET_OPT_USEASLIST, NULL);
+            LY_CHECK_GOTO(ret, cleanup);
         }
     }