nyx/tests/fixtures/state/handle_overwrite.c

12 lines
403 B
C
Raw Permalink Normal View History

#include <stdio.h>
/* The first fopen result is overwritten by the second fopen.
The first handle leaks silently because per-variable tracking
loses the old allocation. The second handle is properly closed.
Expected: NO state- findings (known per-variable-tracking limitation). */
void overwrite_handle(void) {
FILE *f = fopen("a.txt", "r");
f = fopen("b.txt", "r");
fclose(f);
}