This function must return 0 on failure

Dicovered by scan-build
Merged Pull Request #369

* pull-request/369:
  This function must return 0 on failure