diff --git a/src/common.c b/src/common.c
index 8f69dda..03dd81c 100644
--- a/src/common.c
+++ b/src/common.c
@@ -183,7 +183,7 @@
         len = 1;
 
         if ((c < 0x20) && (c != 0x9) && (c != 0xa) && (c != 0xd)) {
-            return LY_EINVAL;
+            goto error;
         }
     } else if ((c & 0xe0) == 0xc0) {
         /* two bytes character */
@@ -191,12 +191,12 @@
 
         aux = (*input)[1];
         if ((aux & 0xc0) != 0x80) {
-            return LY_EINVAL;
+            goto error;
         }
         c = ((c & 0x1f) << 6) | (aux & 0x3f);
 
         if (c < 0x80) {
-            return LY_EINVAL;
+            goto error;
         }
     } else if ((c & 0xf0) == 0xe0) {
         /* three bytes character */
@@ -206,14 +206,14 @@
         for (uint64_t i = 1; i <= 2; i++) {
             aux = (*input)[i];
             if ((aux & 0xc0) != 0x80) {
-                return LY_EINVAL;
+                goto error;
             }
 
             c = (c << 6) | (aux & 0x3f);
         }
 
         if ((c < 0x800) || ((c > 0xd7ff) && (c < 0xe000)) || (c > 0xfffd)) {
-            return LY_EINVAL;
+            goto error;
         }
     } else if ((c & 0xf8) == 0xf0) {
         /* four bytes character */
@@ -223,20 +223,17 @@
         for (uint64_t i = 1; i <= 3; i++) {
             aux = (*input)[i];
             if ((aux & 0xc0) != 0x80) {
-                return LY_EINVAL;
+                goto error;
             }
 
             c = (c << 6) | (aux & 0x3f);
         }
 
         if ((c < 0x1000) || (c > 0x10ffff)) {
-            return LY_EINVAL;
+            goto error;
         }
     } else {
-        if (bytes_read) {
-            (*bytes_read) = 0;
-        }
-        return LY_EINVAL;
+        goto error;
     }
 
     (*utf8_char) = c;
@@ -245,6 +242,12 @@
         (*bytes_read) = len;
     }
     return LY_SUCCESS;
+
+error:
+    if (bytes_read) {
+        (*bytes_read) = 0;
+    }
+    return LY_EINVAL;
 }
 
 /**
