Fixed coverity issues in acl_program.cpp #228
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed coverity in acl_program.cpp: Dead default in switch (DEADCODE)
(line 256) Default branch never reached since
switch (pass)
only has 0 and 1 as values becausepass
is defined in a for-loop (line 225) as< 2
.Fixed coverity in acl_program.cpp: Dereference before null check (REVERSE_INULL)
(line 145) Program is already dereferenced in the for-loop above to check
program->num_devices
, so the check would also pass.Fixed coverity in acl_program.cpp: Use after free (USE_AFTER_FREE)
(line 1834) Coverity complains that you should not print the pointer address value if it has already been freed. Since we are not accessing what's in the pointer itself, it is safe to query about pointer address value. Therefore, instead of passing the pointer as the argument, a dereferenced pointer to that pointer is passed as an argument instead.