TAPI: coverity bug fix
Merge pull request #2388 from alalek:coverity_bug_fix