diff options
author | Shao Miller <sha0.miller@gmail.com> | 2012-11-04 21:23:09 -0500 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2012-11-05 08:33:15 +0000 |
commit | dd59314c304ec83bee927af7395af5ceb4942f66 (patch) | |
tree | 23f3b01b8783f706587bc7cd8fe66188222fe641 | |
parent | 2bc5ea50ca5f670c1101d7986a70adfc5cae8b48 (diff) | |
download | syslinux-dd59314c304ec83bee927af7395af5ceb4942f66.tar.gz syslinux-dd59314c304ec83bee927af7395af5ceb4942f66.tar.xz syslinux-dd59314c304ec83bee927af7395af5ceb4942f66.zip |
core: Fix realloc() code transcription error
Commit 79459f631546eea83d4158f535c20ebd4ac18987 copied portions of
com32/lib/realloc.c into core/mem/malloc.c, with minor changes
for accessing allocation arena header attributes. The previous
code used structure members and the current code uses bitmask
macros.
On a particular line in the original realloc(), there were two
assignments in a single expression that included a compound
assignment. This fact was missed when the code was copied and
modified to use the bitmask macros.
Signed-off-by: Shao Miller <sha0.miller@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r-- | core/mem/malloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/mem/malloc.c b/core/mem/malloc.c index fa1d26a7..19681726 100644 --- a/core/mem/malloc.c +++ b/core/mem/malloc.c @@ -152,9 +152,9 @@ void *realloc(void *ptr, size_t size) ah->a.next->a.prev = ah; nah->next_free->prev_free = nah->prev_free; nah->prev_free->next_free = nah->next_free; - ARENA_SIZE_SET(ah->a.attrs, ARENA_SIZE_GET(nah->a.attrs)); + ARENA_SIZE_SET(ah->a.attrs, ARENA_SIZE_GET(ah->a.attrs) + + ARENA_SIZE_GET(nah->a.attrs)); xsize = ARENA_SIZE_GET(ah->a.attrs); - //xsize = (ah->a.size += nah->a.size); } if (xsize >= newsize) { |