mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Update.
1998-09-01 17:53 Ulrich Drepper <drepper@cygnus.com> * elf/dl-load.c (add_name_to_object): Change return type to void and make NAME parameter const. Allocate room for NAME in same memory block used for l_libname entry. (_dl_map_object_from_fd): Don't free NAME on failure. (map_segment): Pass SONAME to add_name_to_object, not a copy. (_dl_map_object): Don't create copy of NAME. Pass NAME to _dl_map_object_from_fd. * elf/dl-object.c (dl_new_object): Allocate room for NAME in same memory block used for l_libname entry. * elf/dl-close.c: Adjust free()ing for this change.
This commit is contained in:
@ -35,14 +35,14 @@ struct link_map *
|
||||
internal_function
|
||||
_dl_new_object (char *realname, const char *libname, int type, int find_origin)
|
||||
{
|
||||
struct link_map *new = malloc (sizeof *new);
|
||||
struct libname_list *newname = malloc (sizeof *newname);
|
||||
size_t libname_len = strlen (libname) + 1;
|
||||
struct link_map *new = calloc (sizeof *new, 1);
|
||||
struct libname_list *newname = malloc (sizeof *newname + libname_len);
|
||||
if (! new || ! newname)
|
||||
return NULL;
|
||||
|
||||
memset (new, 0, sizeof *new);
|
||||
new->l_name = realname;
|
||||
newname->name = libname;
|
||||
newname->name = memcpy (newname + 1, libname, libname_len);
|
||||
newname->next = NULL;
|
||||
new->l_libname = newname;
|
||||
new->l_type = type;
|
||||
|
Reference in New Issue
Block a user