Skip to content
Snippets Groups Projects
Commit 81f40c4a authored by Guillem Jover's avatar Guillem Jover
Browse files

libdpkg: Remove MDEBUG support from m_malloc() implementation

There are better memory leak and overflow detector tools around, there
is no need for this ad-hoc implementation that might not detect memory
misuse anyway.

Changelog: internal
parent 679760fd
No related branches found
No related tags found
1 merge request!4Update crimson to version from bookworm
......@@ -45,22 +45,7 @@ must_alloc(void *ptr)
}
void *m_malloc(size_t amount) {
#ifdef MDEBUG
unsigned short *ptr_canary, canary;
#endif
void *ptr;
ptr = must_alloc(malloc(amount));
#ifdef MDEBUG
ptr_canary = ptr;
canary = (unsigned short)amount ^ 0xf000;
while (amount >= 2) {
*ptr_canary++ = canary;
amount -= 2;
}
#endif
return ptr;
return must_alloc(malloc(amount));
}
void *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment