diff options
Diffstat (limited to 'storage/innobase/include/mem0mem.h')
-rw-r--r-- | storage/innobase/include/mem0mem.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/storage/innobase/include/mem0mem.h b/storage/innobase/include/mem0mem.h index 6d0f95cba19..fa22b3d3086 100644 --- a/storage/innobase/include/mem0mem.h +++ b/storage/innobase/include/mem0mem.h @@ -237,7 +237,10 @@ inline void* mem_heap_dup(mem_heap_t* heap, const void* data, size_t len) { - return(memcpy(mem_heap_alloc(heap, len), data, len)); + ut_ad(data || !len); + return UNIV_LIKELY(data != NULL) + ? memcpy(mem_heap_alloc(heap, len), data, len) + : NULL; } /** Duplicate a NUL-terminated string, allocated from a memory heap. |