, ".") == 0)
{
free (CONST_CAST (char *, multilib_os_dir));
...
As suggested by Jakub, ensure the "." case is also malloc'd via
xstrdup() and hence the pointer for the "." case can be freed.
Cc: Jakub Jelinek
Cc: Jeff Law
Cc: Matthias Klose
CC: To
[Re: [PATCH] gcc: fix segfault from calling free on non-malloc'd area] On
23/06/2014 (Mon 14:32) Jeff Law wrote:
> On 06/23/14 14:09, Tobias Burnus wrote:
> >This patch broke bootstrapping for me on x86-64-gnu-linux:
> >
> >/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld
the check on whether we are using
the internal string "." or an allocated one is reversed.
We should be calling free() when the string is not equal to
the internal "." string.
Signed-off-by: Paul Gortmaker
---
[Found and fixed on gcc-4.9.0 but applies to git/master too]
gcc/