Noticed malloc() could become unaligned

Signed-off-by: Andy Green <[EMAIL PROTECTED]>
---

 src/utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/utils.c b/src/utils.c
index 3d72ec2..7e92288 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -271,7 +271,7 @@ void *malloc(size_t size)
 {
        void *p = malloc_pointer;
 
-       malloc_pointer += size;
+       malloc_pointer += (size & ~3) + 4;
 
        if (((u8 *)malloc_pointer - &malloc_pool[0]) > sizeof(malloc_pool)) {
                puts("Ran out of malloc pool\n");


Reply via email to