Fix memory leak in lex_test.c

(cherry picked from commit 7a3eb391)
19 jobs for 711-fix-memory-leak-in-lex_test-v9_12 in 13 minutes and 46 seconds (queued for 25 seconds)