diff options
| author | Bertrik Sikken <bertrik@sikken.nl> | 2012-07-26 12:29:18 +0200 |
|---|---|---|
| committer | Bertrik Sikken <bertrik@sikken.nl> | 2012-07-26 12:29:18 +0200 |
| commit | 132fcca4b26865a3152502856928cec8d87496ce (patch) | |
| tree | 79678b3bb2733cf8faaaa3f0eeffd3f305b83202 /lib | |
| parent | 4348b4585704ede2f13a72b7f91a06d041316a1c (diff) | |
| download | rockbox-132fcca4b26865a3152502856928cec8d87496ce.zip rockbox-132fcca4b26865a3152502856928cec8d87496ce.tar.gz rockbox-132fcca4b26865a3152502856928cec8d87496ce.tar.bz2 rockbox-132fcca4b26865a3152502856928cec8d87496ce.tar.xz | |
Make codec_realloc retain the contents when resizing a memory segment
Change-Id: Ia2fc42eb0d36399e6856d3a957dd1634f019ca6a
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/rbcodec/codecs/lib/codeclib.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rbcodec/codecs/lib/codeclib.c b/lib/rbcodec/codecs/lib/codeclib.c index 4859da3..09c96f9 100644 --- a/lib/rbcodec/codecs/lib/codeclib.c +++ b/lib/rbcodec/codecs/lib/codeclib.c @@ -90,8 +90,9 @@ void codec_free(void* ptr) { void* codec_realloc(void* ptr, size_t size) { void* x; - (void)ptr; x = codec_malloc(size); + memcpy(x, ptr, size); + codec_free(ptr); return(x); } |