mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-12 19:55:14 +02:00
12 lines
403 B
C
12 lines
403 B
C
|
|
#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);
|
||
|
|
}
|