+2014-10-28 Carlos O'Donell <carlos@redhat.com>
+
+ * dl-load.c (local_strdup): Remove.
+ (expand_dynamic_string_token): Use __strdup.
+ (decompose_rpath): Likewise.
+ (_dl_map_object): Likewise.
+
2014-10-28 Joseph Myers <joseph@codesourcery.com>
[BZ #14132]
(sizeof (system_dirs_len) / sizeof (system_dirs_len[0]))
-/* Local version of `strdup' function. */
-static char *
-local_strdup (const char *s)
-{
- size_t len = strlen (s) + 1;
- void *new = malloc (len);
-
- if (new == NULL)
- return NULL;
-
- return (char *) memcpy (new, s, len);
-}
-
-
static bool
is_trusted_path (const char *path, size_t len)
{
/* If we do not have to replace anything simply copy the string. */
if (__glibc_likely (cnt == 0))
- return local_strdup (s);
+ return __strdup (s);
/* Determine the length of the substituted string. */
total = DL_DST_REQUIRED (l, s, strlen (s), cnt);
}
/* Make a writable copy. */
- copy = local_strdup (rpath);
+ copy = __strdup (rpath);
if (copy == NULL)
{
errstring = N_("cannot create RUNPATH/RPATH copy");
false);
if (__glibc_likely (fd != -1))
{
- realname = local_strdup (cached);
+ realname = __strdup (cached);
if (realname == NULL)
{
__close (fd);
/* The path may contain dynamic string tokens. */
realname = (loader
? expand_dynamic_string_token (loader, name, 0)
- : local_strdup (name));
+ : __strdup (name));
if (realname == NULL)
fd = -1;
else
static const Elf_Symndx dummy_bucket = STN_UNDEF;
/* Allocate a new object map. */
- if ((name_copy = local_strdup (name)) == NULL
+ if ((name_copy = __strdup (name)) == NULL
|| (l = _dl_new_object (name_copy, name, type, loader,
mode, nsid)) == NULL)
{