1
0
forked from aniani/vim

patch 8.2.1188: memory leak with invalid json input

Problem:    Memory leak with invalid json input.
Solution:   Free all keys at the end. (Dominique Pellé, closes #6443,
            closes #6442)
This commit is contained in:
Bram Moolenaar
2020-07-12 14:34:00 +02:00
parent c85156bb89
commit 6d3a7213f5
3 changed files with 8 additions and 5 deletions

View File

@@ -201,6 +201,8 @@ func Test_json_decode()
call assert_fails('call json_decode("\"\\u111Z\"")', 'E491:')
call assert_equal('[😂]', json_decode('"[\uD83D\uDE02]"'))
call assert_equal('a😂b', json_decode('"a\uD83D\uDE02b"'))
call assert_fails('call json_decode("{\"\":{\"\":{")', 'E491:')
endfunc
let s:jsl5 = '[7,,,]'