patch 9.1.1035: Vim9: memory leak with blob2str()
Problem: Vim9: memory leak with blob2str()
Solution: free converted_str (Yegappan Lakshmanan)
closes: #16481
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index bf3e889..e31e2ed 100644
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -4311,6 +4311,10 @@
call assert_equal(["🁰🁳"], blob2str(0zF09F81B0.F09F81B3))
call assert_equal(['«»'], blob2str(0zABBB, {'encoding': 'latin1'}))
call assert_equal(['«»'], blob2str(0zC2ABC2BB, {'encoding': 'utf8'}))
+ call assert_equal(['«»'], blob2str(0zC2ABC2BB, {'encoding': 'utf-8'}))
+
+ call assert_equal(['a'], blob2str(0z61, test_null_dict()))
+ call assert_equal(['a'], blob2str(0z61, {'encoding': test_null_string()}))
#" Invalid encoding
call assert_fails("call blob2str(0z80)", "E1515: Unable to convert from 'utf-8' encoding")