Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mesa/program: fix memory leak triggered by parser errors
This change requires the %destructor directive which is supported by bison or yacc, yacc needs to be compiled with the back-tracking functionality. This issue could be checked with the following piglit programs: glsl-invalid-asm-01, glsl-invalid-asm-02 or vp-bad-program Direct leak of 5 byte(s) in 1 object(s) allocated from: #0 0x7f8dc89050 in __interceptor_strdup (/usr/lib64/libasan.so.6+0x59050) #1 0x7f83791cbc in handle_ident ../src/mesa/program/program_lexer.l:129 #2 0x7f83791cbc in _mesa_program_lexer_lex ../src/mesa/program/program_lexer.l:312 #3 0x7f8377e8d8 in yylex ../src/mesa/program/program_parse.y:289 #4 0x7f8377e8d8 in yyparse src/mesa/program/program_parse.tab.c:2124 #5 0x7f83788c14 in _mesa_parse_arb_program ../src/mesa/program/program_parse.y:2584 #6 0x7f8377371c in _mesa_parse_arb_fragment_program ../src/mesa/program/arbprogparse.c:82 #7 0x7f8372d42c in set_program_string ../src/mesa/main/arbprogram.c:402 Signed-off-by: Patrick Lerda <[email protected]> Acked-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21150>
- Loading branch information