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)
Merge pull request #1165 from serval2412/master

Fix some cppcheck reports (part3)