Check return value of library call Coverity issues

In three cases i just added logs in case of error conditions. You may want to revise that and add proper error handling if applicable.