We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0392867 commit 4e91a2dCopy full SHA for 4e91a2d
1 file changed
h_malloc.c
@@ -1748,6 +1748,10 @@ EXPORT void h_free_sized(void *p, size_t expected_size) {
1748
expected_size = adjust_size_for_canary(expected_size);
1749
1750
if (p < get_slab_region_end() && p >= ro.slab_region_start) {
1751
+ if (unlikely(expected_size > max_slab_size_class)) {
1752
+ fatal_error("sized deallocation mismatch (small)");
1753
+ }
1754
+
1755
thread_unseal_metadata();
1756
expected_size = get_size_info(expected_size).size;
1757
deallocate_small(p, &expected_size);
0 commit comments