* remap.c (remap_debug_filename): Always allocate a buffer for the
returned pointer. * stabs.c (stabs_generate_asm_file): Free the pointer returned by remap_debug_filename.
This commit is contained in:
parent
f2eb0bc849
commit
502df13057
|
@ -1,3 +1,10 @@
|
||||||
|
2011-03-11 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
* remap.c (remap_debug_filename): Always allocate a buffer for the
|
||||||
|
returned pointer.
|
||||||
|
* stabs.c (stabs_generate_asm_file): Free the pointer returned by
|
||||||
|
remap_debug_filename.
|
||||||
|
|
||||||
2011-03-10 Michael Snyder <msnyder@vmware.com>
|
2011-03-10 Michael Snyder <msnyder@vmware.com>
|
||||||
|
|
||||||
Revert the following change:
|
Revert the following change:
|
||||||
|
|
|
@ -65,8 +65,9 @@ add_debug_prefix_map (const char *arg)
|
||||||
debug_prefix_maps = map;
|
debug_prefix_maps = map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Perform user-specified mapping of debug filename prefixes. Return
|
/* Perform user-specified mapping of debug filename prefixes. Returns
|
||||||
the new name corresponding to FILENAME. */
|
a newly allocated buffer containing the name corresponding to FILENAME.
|
||||||
|
It is the caller's responsibility to free the buffer. */
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
remap_debug_filename (const char *filename)
|
remap_debug_filename (const char *filename)
|
||||||
|
@ -80,7 +81,7 @@ remap_debug_filename (const char *filename)
|
||||||
if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
|
if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
|
||||||
break;
|
break;
|
||||||
if (!map)
|
if (!map)
|
||||||
return filename;
|
return xstrdup (filename);
|
||||||
name = filename + map->old_len;
|
name = filename + map->old_len;
|
||||||
name_len = strlen (name) + 1;
|
name_len = strlen (name) + 1;
|
||||||
s = (char *) alloca (name_len + map->new_len);
|
s = (char *) alloca (name_len + map->new_len);
|
||||||
|
|
|
@ -502,6 +502,7 @@ stabs_generate_asm_file (void)
|
||||||
dir2 = (char *) alloca (strlen (dir) + 2);
|
dir2 = (char *) alloca (strlen (dir) + 2);
|
||||||
sprintf (dir2, "%s%s", dir, "/");
|
sprintf (dir2, "%s%s", dir, "/");
|
||||||
generate_asm_file (N_SO, dir2);
|
generate_asm_file (N_SO, dir2);
|
||||||
|
xfree ((char *) dir);
|
||||||
}
|
}
|
||||||
generate_asm_file (N_SO, file);
|
generate_asm_file (N_SO, file);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue