Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Fix null pointer issue reported by cppcheck static analysis tool
cppcheck analysis tool reports the following issues when run on the latest Cairo source. $ grep "(error)" cppcheck_error_log.txt [test/pdf-mime-data.c:58]: (error) Possible null pointer dereference: file - otherwise it is redundant to check if file is null at line 53 [test/pdf-mime-data.c:75]: (error) Resource leak: fp $ The proposed changes fixes the above issues. And also it does some refactoring to print the appropriate error messages for each error condition in read_file() function and also to free the allocated data buffer. Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
- Loading branch information