When we runtime-attach heaptrack, we may encounter frees for
allocations that we did not track, i.e. those that happened before
we attached. In such cases, we used to decrase the leaked allocation
counter, and that potentially underflowed then. This is fixed now.
lastPtr = ptr;
fprintf(stdout, "+ %x\n", index.index);
} else if (reader.mode() == '-') {
- --leakedAllocations;
uint64_t ptr = 0;
if (!(reader >> ptr)) {
cerr << "failed to parse line: " << reader.line() << endl;
if (temporary) {
++temporaryAllocations;
}
+ --leakedAllocations;
} else {
fputs(reader.line().c_str(), stdout);
fputc('\n', stdout);