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 arb alias
The function _mesa_symbol_table_add_symbol() copies the string with strdup(), the original string should be freed. For instance, with "piglit/fp-fragment-position -auto -fbo": Direct leak of 7 byte(s) in 1 object(s) allocated from: #0 0xffff99c59050 in __interceptor_strdup (/usr/lib64/libasan.so.6+0x59050) #1 0xffff8f53d24c in handle_ident ../src/mesa/program/program_lexer.l:129 #2 0xffff8f53d24c in _mesa_program_lexer_lex ../src/mesa/program/program_lexer.l:312 #3 0xffff8f529d10 in yylex ../src/mesa/program/program_parse.y:289 #4 0xffff8f529d10 in yyparse src/mesa/program/program_parse.tab.c:2140 #5 0xffff8f5341a4 in _mesa_parse_arb_program ../src/mesa/program/program_parse.y:2589 #6 0xffff8f51e96c in _mesa_parse_arb_fragment_program ../src/mesa/program/arbprogparse.c:82 #7 0xffff8f4d867c in set_program_string ../src/mesa/main/arbprogram.c:402 Signed-off-by: Patrick Lerda <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21728>
- Loading branch information