Merge pull request #1164 from serval2412/master

Fix cppcheck reports (part2):
Fix some cppcheck reports (part3)
- (error) Resource leak: f
- (style) Statements following return, break, continue, goto or throw will never be executed (1 of them)
- (style) Unused variable (most of them)