summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2012-07-26 12:29:18 +0200
committerBertrik Sikken <bertrik@sikken.nl>2012-07-26 12:29:18 +0200
commit132fcca4b26865a3152502856928cec8d87496ce (patch)
tree79678b3bb2733cf8faaaa3f0eeffd3f305b83202 /lib
parent4348b4585704ede2f13a72b7f91a06d041316a1c (diff)
downloadrockbox-132fcca4b26865a3152502856928cec8d87496ce.tar.gz
rockbox-132fcca4b26865a3152502856928cec8d87496ce.zip
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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rbcodec/codecs/lib/codeclib.c b/lib/rbcodec/codecs/lib/codeclib.c
index 4859da3155..09c96f921c 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);
}