Re: [PATCH] calls: Fix a memory leak in maybe_warn_rdwr_sizes [PR99004]

2021-02-09 Thread Richard Biener
On Tue, 9 Feb 2021, Jakub Jelinek wrote: > Hi! > > The print_generic_expr_to_str function ends with > return xstrdup (...); and therefore expects the caller to free > the argument. > > The following patch does that after it has been copied. > Instead of doing const_cast to cast away const char *

[PATCH] calls: Fix a memory leak in maybe_warn_rdwr_sizes [PR99004]

2021-02-09 Thread Jakub Jelinek via Gcc-patches
Hi! The print_generic_expr_to_str function ends with return xstrdup (...); and therefore expects the caller to free the argument. The following patch does that after it has been copied. Instead of doing const_cast to cast away const char * to char *, because the code uses s0 and s1 in so few plac