mirror of
git://repo.or.cz/tinycc.git
synced 2026-11-04 21:26:36 +08:00
libtcc: Fix a double free, when option -o is used twice
Some checks failed
build and test / test-x86_64-linux (push) Has been cancelled
build and test / test-x86_64-osx (push) Has been cancelled
build and test / test-aarch64-osx (push) Has been cancelled
build and test / test-x86-win32 (push) Has been cancelled
build and test / test-armv7-linux (push) Has been cancelled
build and test / test-aarch64-linux (push) Has been cancelled
build and test / test-riscv64-linux (push) Has been cancelled
Some checks failed
build and test / test-x86_64-linux (push) Has been cancelled
build and test / test-x86_64-osx (push) Has been cancelled
build and test / test-aarch64-osx (push) Has been cancelled
build and test / test-x86-win32 (push) Has been cancelled
build and test / test-armv7-linux (push) Has been cancelled
build and test / test-aarch64-linux (push) Has been cancelled
build and test / test-riscv64-linux (push) Has been cancelled
tcc_set_str() already calls tcc_free() to free the memory of the stringpointer in s->outfile. With the additional tcc_free(), the memory would be freed twice. -- Regards ... Detlef
This commit is contained in:
parent
f2b9fcf85d
commit
5fad6dc4a3
1
libtcc.c
1
libtcc.c
@ -1993,7 +1993,6 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int *pargc, char ***pargv)
|
|||||||
case TCC_OPTION_o:
|
case TCC_OPTION_o:
|
||||||
if (s->outfile) {
|
if (s->outfile) {
|
||||||
tcc_warning("multiple -o option");
|
tcc_warning("multiple -o option");
|
||||||
tcc_free(s->outfile);
|
|
||||||
}
|
}
|
||||||
tcc_set_str(&s->outfile, optarg);
|
tcc_set_str(&s->outfile, optarg);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user