Skip to content

Commit

Permalink
Fix some corner-case file descriptor leaks
Browse files Browse the repository at this point in the history
Credits to @ryancaicse for the analysis and report in #2714

(cherry picked from commit 3ca4d8c)
  • Loading branch information
liviuchircu committed Jan 7, 2022
1 parent ab5f0f8 commit 0019f55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions menuconfig/parser.c
Expand Up @@ -365,6 +365,7 @@ int parse_defs_m4(select_menu *curr_menu,cfg_gen_t *curr_cfg)

if (parse_defs_m4_line(p,curr_menu) < 0) {
fprintf(output,"Failed to parse m4 line [%s]\n",p);
fclose(f);
return -1;
}
}
Expand Down
2 changes: 2 additions & 0 deletions utils/db_berkeley/bdb_recover.c
Expand Up @@ -331,6 +331,7 @@ int recover(char* jfn)
{
fprintf(stderr, "[recover]: Table %s is not supported.\n",tn);
fprintf(stderr, "[recover]: FAILED to load journal file: %s.\n", jfn);
fclose(fp);
return 2;
}

Expand All @@ -339,6 +340,7 @@ int recover(char* jfn)
if(!tbc || !tp)
{
fprintf(stderr, "[recover]: FAILED to get find metadata for : %s.\n", tn);
fclose(fp);
return 3;
}

Expand Down

0 comments on commit 0019f55

Please sign in to comment.