diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/malloc.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/malloc.c b/src/lib/malloc.c index bd403e47e9..4a60012500 100644 --- a/src/lib/malloc.c +++ b/src/lib/malloc.c @@ -46,6 +46,23 @@ void *malloc(size_t size) return p; } +void *realloc(void *mem, size_t size) +{ + void *new_mem; + + if (mem == 0) + return malloc(size); + if (size == 0) { + free(mem); + return 0; + } + + new_mem = malloc(size); + memcpy(new_mem, mem, size); + free(mem); + return new_mem; +} + void free(void *where) { /* Don't care */ |