Skip to content

Commit

Permalink
doc: fix coverity warnings in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sekrit-twc committed Aug 17, 2016
1 parent 36ec209 commit 8fdcad0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/example/api_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ int main(int argc, char **argv)
return 2;
} catch (const std::logic_error &e) {
std::cerr << "logic_error: " << e.what() << '\n';
throw;
return 2;
}

return 0;
Expand Down
6 changes: 4 additions & 2 deletions doc/example/api_example_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ static int read_image_from_file(const char *path, unsigned w, unsigned h, void *

ret = 0;
fail:
fclose(file);
if (file)
fclose(file);
return ret;
}

Expand Down Expand Up @@ -138,7 +139,8 @@ static int write_image_to_file(const char *path, unsigned w, unsigned h, const v

ret = 0;
fail:
fclose(file);
if (file)
fclose(file);
return ret;
}

Expand Down

0 comments on commit 8fdcad0

Please sign in to comment.