calls: Fix a memory leak in maybe_warn_rdwr_sizes [PR99004]
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 places, I chose just
to change the types of the two variables so that const_cast
is not needed. After all, it is a heap allocated string that
this function owns and so if it wanted, it could change it too.
2021-02-09 Jakub Jelinek <jakub@redhat.com>
PR middle-end/99004
* calls.c (maybe_warn_rdwr_sizes): Change s0 and s1 type from
const char * to char * and free those pointers after use.