Fix more coverity warnings

Assorted minor code issues, which we should fix so any new errors stand
out more.

BUG=chromium:643769
BRANCH=none
TEST=make runtests

Change-Id: I82ece2de948ef224115c408bdfc09445d3da119b
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/390337
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
This commit is contained in:
Randall Spangler
2016-09-28 11:54:20 -07:00
committed by chrome-bot
parent fefc682bb7
commit 770202f0c7
8 changed files with 51 additions and 27 deletions

View File

@@ -37,8 +37,10 @@ uint8_t* ReadFile(const char* filename, uint64_t* sizeptr) {
fseek(f, 0, SEEK_END);
size = ftell(f);
if (size < 0)
if (size < 0) {
fclose(f);
return NULL;
}
rewind(f);
buf = malloc(size);