check fseek return value (coverity 1109837)

This commit is contained in:
Vincent Sanders 2014-05-18 12:51:49 +01:00
parent 17b347a260
commit 3b42f73b5a
1 changed files with 5 additions and 1 deletions

View File

@ -360,7 +360,11 @@ struct container_ctx *container_create(const char *filename,
* we don't know where it'll be yet!
*/
fseek(ctx->fh, 108, SEEK_SET);
if (fseek(ctx->fh, 108, SEEK_SET) == -1) {
LOG(("directory offset seek failed"));
free(ctx);
return NULL;
}
return ctx;
}