mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-21 20:18:06 +02:00
13 lines
247 B
C
13 lines
247 B
C
|
|
#include <stdio.h>
|
||
|
|
|
||
|
|
/* Both branches close f — no leak on any path.
|
||
|
|
Expected: NO state- findings. */
|
||
|
|
void both_close(int cond) {
|
||
|
|
FILE *f = fopen("data.txt", "r");
|
||
|
|
if (cond) {
|
||
|
|
fclose(f);
|
||
|
|
} else {
|
||
|
|
fclose(f);
|
||
|
|
}
|
||
|
|
}
|