c, c++: Plug -Wduplicated-cond memory leaks [PR99057]
authorMarek Polacek <polacek@redhat.com>
Wed, 10 Feb 2021 17:07:10 +0000 (12:07 -0500)
committerMarek Polacek <polacek@redhat.com>
Thu, 11 Feb 2021 03:17:43 +0000 (22:17 -0500)
commit27a804bc62805aedb1b097a00eb2c0059244680a
treee01d31872c8d23236b943ecd2b633600e9dae569
parent4b37c3ea8ab037292b0fcd62d4193ba1c2e657fe
c, c++: Plug -Wduplicated-cond memory leaks [PR99057]

Freeing the condition chain needs to use vec_free which does ->release,
or we leak memory.

gcc/c/ChangeLog:

* c-parser.c (c_parser_if_statement): Use vec_free.

gcc/cp/ChangeLog:

* parser.c (cp_parser_selection_statement): Use vec_free.
gcc/c/c-parser.c
gcc/cp/parser.c