Skip to content

Commit

Permalink
di_log: extract: fix resource leak warning
Browse files Browse the repository at this point in the history
  • Loading branch information
furmur committed Dec 16, 2024
1 parent 812dbe7 commit 99f3932
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/di_log/tools/extract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ int main(int argc, char **argv)

if(argc > 2) {
if(stat(out_path,&s)==0) {
fclose(in);
err("output file '%s' already exists\n",out_path);
}
out = fopen(out_path,"w");
if(!out) {
fclose(in);
err("can't open output file '%s' for writing\n",out_path);
return EXIT_FAILURE;
}
}

Expand Down

0 comments on commit 99f3932

Please sign in to comment.