Skip to content

Commit

Permalink
Don't leak a file descriptor in the efivar utility.
Browse files Browse the repository at this point in the history
Doesn't really matter, but I'd like smaller covscan results.

Signed-off-by: Peter Jones <pjones@redhat.com>
  • Loading branch information
vathpela committed Sep 11, 2014
1 parent 670671e commit 0b4be25
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/efivar.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,11 @@ prepare_data(const char *filename, void **data, size_t *data_size)
*data = buf;
*data_size = buflen;

close(fd);
return;
err:
if (fd >= 0)
close(fd);
fprintf(stderr, "Could not use \"%s\": %m\n", filename);
exit(1);
}
Expand Down

0 comments on commit 0b4be25

Please sign in to comment.