* emultempl/elf32.em (gld${EMULATION_NAME}_add_sysroot): Fix

memory allocation error.
This commit is contained in:
Alexandre Oliva 2003-02-26 00:56:14 +00:00
parent 66f24a0b52
commit 42644a8920
2 changed files with 4 additions and 1 deletions

View file

@ -1,5 +1,8 @@
2003-02-25 Alexandre Oliva <aoliva@redhat.com>
* emultempl/elf32.em (gld${EMULATION_NAME}_add_sysroot): Fix
memory allocation error.
* Makefile.am (ldmain.o): Define TOOLBINDIR.
* Makefile.in: Rebuilt.
* ldmain.c (ld_sysroot): Try to set from TOOLBINDIR too.

View file

@ -461,7 +461,7 @@ gld${EMULATION_NAME}_add_sysroot (path)
if (path[i])
colons++;
len = len + colons * strlen (ld_sysroot);
len = len + (colons + 1) * strlen (ld_sysroot);
ret = xmalloc (len + 1);
strcpy (ret, ld_sysroot);
p = ret + strlen (ret);