3 ms·
No? Take this code: void foo(int arg) { int *x = malloc(sizeof(int)); if (arg) { free(x); } } If your test only ev
by mort96 4y ago
No? Take this code:
void foo(int arg) {
int *x = malloc(sizeof(int));
if (arg) {
free(x);
}
}
If your test only ever calls `foo` with a non-zero `arg`, you have covered 100% of the lines in the function, but you never discover the memory leak bug in the case where `if` body isn't executed.