symbiotic
symbiotic copied to clipboard
Missed memory leak when only a part of the pointer is overwritten
This code has a memory leak as the a[1] = 20
overwrites the pointer to the malloced memory.
int main() {
void *p = malloc(3U);
char *a = (char*) p;
a[1] = 20;
return 1;
}
The problem is that instrumentation does not mark this overwrite as important and it gets sliced away, see https://github.com/mchalupa/dg/issues/345.