about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-03-30 17:42:57 +0000
committerUlrich Drepper <drepper@redhat.com>1998-03-30 17:42:57 +0000
commitf96a51312d9f98a4d8f54f0535e9f944115b7910 (patch)
treeb2a3f62390c8519b650b3cd485ce333970b01452
parent1348a38bde1d01db221f38cd07f8d5e07e5dc078 (diff)
downloadglibc-f96a51312d9f98a4d8f54f0535e9f944115b7910.tar.gz
glibc-f96a51312d9f98a4d8f54f0535e9f944115b7910.tar.xz
glibc-f96a51312d9f98a4d8f54f0535e9f944115b7910.zip
(_dl_open): Fix a typo.
(_dl_global_scope_alloc): Make it static.
-rw-r--r--elf/dl-open.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 63a7091fff..c093e54302 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -36,7 +36,7 @@ extern char **__libc_argv;
 
 extern char **__environ;
 
-size_t _dl_global_scope_alloc;
+static size_t _dl_global_scope_alloc;
 
 struct link_map *
 _dl_open (const char *file, int mode)
@@ -101,7 +101,8 @@ _dl_open (const char *file, int mode)
 	{
 	  /* This is the first dynamic object given global scope.  */
 	  _dl_global_scope_alloc = 8;
-	  _dl_global_scope = malloc (8 * sizeof (struct link_map *));
+	  _dl_global_scope = malloc (_dl_global_scope_alloc
+				     * sizeof (struct link_map *));
 	  if (! _dl_global_scope)
 	    {
 	      _dl_global_scope = _dl_default_scope;
@@ -122,7 +123,8 @@ _dl_open (const char *file, int mode)
 	    {
 	      /* Must extend the list.  */
 	      struct link_map **new = realloc (_dl_global_scope,
-					       _dl_global_scope_alloc * 2);
+					       _dl_global_scope_alloc * 2
+					       * sizeof (struct link_map *));
 	      if (! new)
 		goto nomem;
 	      _dl_global_scope_end = new + (_dl_global_scope_end -