OSDN Git Service
(root)
/
uclinux-h8
/
uClibc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8b02a71
)
(realloc): Record the correct size in the malloc header in the case
author
Miles Bader
<miles@lsi.nec.co.jp>
Mon, 9 Sep 2002 07:40:07 +0000
(07:40 -0000)
committer
Miles Bader
<miles@lsi.nec.co.jp>
Mon, 9 Sep 2002 07:40:07 +0000
(07:40 -0000)
where we extended the existing allocation, and got back more than we
asked for from the heap.
libc/stdlib/malloc/realloc.c
patch
|
blob
|
history
diff --git
a/libc/stdlib/malloc/realloc.c
b/libc/stdlib/malloc/realloc.c
index
db26866
..
e4c8ad7
100644
(file)
--- a/
libc/stdlib/malloc/realloc.c
+++ b/
libc/stdlib/malloc/realloc.c
@@
-57,7
+57,7
@@
realloc (void *mem, size_t new_size)
if (extra)
/* Record the changed size. */
- MALLOC_SET_SIZE (base_mem,
new_size
);
+ MALLOC_SET_SIZE (base_mem,
size + extra
);
else
/* Our attempts to extend MEM in place failed, just
allocate-and-copy. */