mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
Because memcpy() is declared by gcc as receiving non-null attributes, gcc assumes that ptr != null, as it is passed into memcpy() (though with a size of zero). As a result it ignores the null pointer check in ::free(), and calls memory::free() directly, which does not expect a null pointer. Fix by only calling memcpy() when the ptr is non-null.
24 KiB
24 KiB