]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
driver: Fix memory leak [PR93019]
authorJakub Jelinek <jakub@redhat.com>
Sat, 9 Dec 2023 09:28:37 +0000 (10:28 +0100)
committerJakub Jelinek <jakub@redhat.com>
Sat, 9 Dec 2023 09:28:37 +0000 (10:28 +0100)
driver:finalize used by JIT clears the mdswitches pointer; if it was
allocated before, that leaks the memory.

2023-12-09  Costas Argyris  <costas.argyris@gmail.com>
    Jakub Jelinek  <jakub@redhat.com>

PR driver/93019
* gcc.cc (driver::finalize): Call XDELETEVEC on mdswitches before
clearing it.

Signed-off-by: Costas Argyris <costas.argyris@gmail.com>
gcc/gcc.cc

index d73fb0414e985816a798b2bdf943aba9e5af6f1a..701f5cdfb59c8f60c9c9bee310ef9de03d1ece27 100644 (file)
@@ -11368,6 +11368,7 @@ driver::finalize ()
   input_from_pipe = 0;
   suffix_subst = NULL;
 
+  XDELETEVEC (mdswitches);
   mdswitches = NULL;
   n_mdswitches = 0;