mirror of
https://github.com/elicpeter/nyx.git
synced 2026-07-18 21:21:03 +02:00
11 lines
257 B
C
11 lines
257 B
C
|
|
#include <stdio.h>
|
||
|
|
|
||
|
|
/* Only the true branch closes f; the false branch leaks.
|
||
|
|
Expected: state-resource-leak-possible (NOT state-resource-leak). */
|
||
|
|
void may_leak(int cond) {
|
||
|
|
FILE *f = fopen("data.txt", "r");
|
||
|
|
if (cond) {
|
||
|
|
fclose(f);
|
||
|
|
}
|
||
|
|
}
|