schema free BUGFIX typo
diff --git a/src/tree_schema_free.c b/src/tree_schema_free.c
index 7c4bf4c..7c367b0 100644
--- a/src/tree_schema_free.c
+++ b/src/tree_schema_free.c
@@ -666,7 +666,7 @@
 void
 lysc_type_free(struct ly_ctx *ctx, struct lysc_type *type)
 {
-    if (LY_ATOMIC_INC_BARRIER(type->refcount) > 1) {
+    if (LY_ATOMIC_DEC_BARRIER(type->refcount) > 1) {
         return;
     }