diff options
Diffstat (limited to 'lib/rbcodec/codecs')
| -rw-r--r-- | lib/rbcodec/codecs/lib/codeclib.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/rbcodec/codecs/lib/codeclib.c b/lib/rbcodec/codecs/lib/codeclib.c index a12038e..1f52c00 100644 --- a/lib/rbcodec/codecs/lib/codeclib.c +++ b/lib/rbcodec/codecs/lib/codeclib.c @@ -91,8 +91,12 @@ void* codec_realloc(void* ptr, size_t size) { void* x; x = codec_malloc(size); - ci->memcpy(x, ptr, size); - codec_free(ptr); + if (x == NULL) + return NULL; + if (ptr) { + ci->memcpy(x, ptr, size); + codec_free(ptr); + } return(x); } |