cppcheck performance fixes in addons/
Check return value
Merge pull request #5992 from tobbi/cppcheck_perf_addons