mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
2001-09-08 Ulrich Drepper <drepper@redhat.com> * elf/dl-object.c: Avoid allocating extra memory block for name. * elf/dl-close.c (_dl_close): Don't free l_libname if it is no allocated separately. * elf/dl-load.c (_dl_map_object_from_fd): Likewise.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2001-09-08 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* elf/dl-object.c: Avoid allocating extra memory block for name.
|
||||||
|
* elf/dl-close.c (_dl_close): Don't free l_libname if it is no
|
||||||
|
allocated separately.
|
||||||
|
* elf/dl-load.c (_dl_map_object_from_fd): Likewise.
|
||||||
|
|
||||||
2001-09-08 H.J. Lu <hjl@gnu.org>
|
2001-09-08 H.J. Lu <hjl@gnu.org>
|
||||||
|
|
||||||
* po/zh_TW.po: Fix a typo.
|
* po/zh_TW.po: Fix a typo.
|
||||||
|
@ -254,7 +254,8 @@ _dl_close (void *_map)
|
|||||||
{
|
{
|
||||||
struct libname_list *this = lnp;
|
struct libname_list *this = lnp;
|
||||||
lnp = lnp->next;
|
lnp = lnp->next;
|
||||||
free (this);
|
if (!this->dont_free)
|
||||||
|
free (this);
|
||||||
}
|
}
|
||||||
while (lnp != NULL);
|
while (lnp != NULL);
|
||||||
|
|
||||||
|
@ -1099,7 +1099,8 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
|
|||||||
/* We are not supposed to load this object. Free all resources. */
|
/* We are not supposed to load this object. Free all resources. */
|
||||||
__munmap ((void *) l->l_map_start, l->l_map_end - l->l_map_start);
|
__munmap ((void *) l->l_map_start, l->l_map_end - l->l_map_start);
|
||||||
|
|
||||||
free (l->l_libname);
|
if (!l->l_libname->dont_free)
|
||||||
|
free (l->l_libname);
|
||||||
|
|
||||||
if (l->l_phdr_allocated)
|
if (l->l_phdr_allocated)
|
||||||
free ((void *) l->l_phdr);
|
free ((void *) l->l_phdr);
|
||||||
|
@ -40,15 +40,17 @@ _dl_new_object (char *realname, const char *libname, int type,
|
|||||||
struct link_map *new;
|
struct link_map *new;
|
||||||
struct libname_list *newname;
|
struct libname_list *newname;
|
||||||
|
|
||||||
new = (struct link_map *) calloc (sizeof *new, 1);
|
new = (struct link_map *) calloc (sizeof (*new) + sizeof (*newname)
|
||||||
newname = (struct libname_list *) malloc (sizeof *newname + libname_len);
|
+ libname_len, 1);
|
||||||
if (new == NULL || newname == NULL)
|
if (new == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
new->l_name = realname;
|
newname = (struct libname_list *) (new + 1);
|
||||||
newname->name = (char *) memcpy (newname + 1, libname, libname_len);
|
newname->name = (char *) memcpy (newname + 1, libname, libname_len);
|
||||||
newname->next = NULL;
|
newname->next = NULL;
|
||||||
newname->dont_free = 0;
|
newname->dont_free = 1;
|
||||||
|
|
||||||
|
new->l_name = realname;
|
||||||
new->l_libname = newname;
|
new->l_libname = newname;
|
||||||
new->l_type = type;
|
new->l_type = type;
|
||||||
new->l_loader = loader;
|
new->l_loader = loader;
|
||||||
|
Reference in New Issue
Block a user