summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--json-lexer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/json-lexer.c b/json-lexer.c
index fe5a060d4d..a5bbe9e54d 100644
--- a/json-lexer.c
+++ b/json-lexer.c
@@ -305,6 +305,9 @@ static int json_lexer_feed_char(JSONLexer *lexer, char ch)
             new_state = IN_START;
             break;
         case IN_ERROR:
+            QDECREF(lexer->token);
+            lexer->token = qstring_new();
+            new_state = IN_START;
             return -EINVAL;
         default:
             break;