summaryrefslogtreecommitdiff
path: root/elf/dl-minimal.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-10-25 19:13:42 +0000
committerJakub Jelinek <jakub@redhat.com>2006-10-25 19:13:42 +0000
commit21cb7ca55c2fdd7e9aca6c7a80ae0d7ca4f6c7da (patch)
tree9bce2d28d077684abe0904fdfb3974e06ceb29f6 /elf/dl-minimal.c
parent16d1b47b4f3f9ae13535ea7a2c02bd207c069d5c (diff)
Updated to fedora-glibc-20061025T1857cvs/fedora-glibc-2_5_90-1
Diffstat (limited to 'elf/dl-minimal.c')
-rw-r--r--elf/dl-minimal.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c
index 868d3bd2ed..8e78709b5a 100644
--- a/elf/dl-minimal.c
+++ b/elf/dl-minimal.c
@@ -1,5 +1,6 @@
/* Minimal replacements for basic facilities used in the dynamic linker.
- Copyright (C) 1995-1998,2000-2002,2004,2005 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998,2000-2002,2004,2005,2006
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -128,14 +129,13 @@ free (void *ptr)
void * weak_function
realloc (void *ptr, size_t n)
{
- void *new;
if (ptr == NULL)
return malloc (n);
assert (ptr == alloc_last_block);
+ size_t old_size = alloc_ptr - alloc_last_block;
alloc_ptr = alloc_last_block;
- new = malloc (n);
- assert (new == ptr);
- return new;
+ void *new = malloc (n);
+ return new != ptr ? memcpy (new, ptr, old_size) : new;
}
/* Avoid signal frobnication in setjmp/longjmp. Keeps things smaller. */