From 5fad6dc4a3cdb7c9094129a4c76e5d2599e94414 Mon Sep 17 00:00:00 2001 From: Detlef Riekenberg Date: Thu, 19 Jun 2025 03:27:59 +0200 Subject: [PATCH] libtcc: Fix a double free, when option -o is used twice 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 --- libtcc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libtcc.c b/libtcc.c index 7d2e650d..b6998ddf 100644 --- a/libtcc.c +++ b/libtcc.c @@ -1993,7 +1993,6 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int *pargc, char ***pargv) case TCC_OPTION_o: if (s->outfile) { tcc_warning("multiple -o option"); - tcc_free(s->outfile); } tcc_set_str(&s->outfile, optarg); break;