Fix CID 1215124: Handle errors properly.
This commit is contained in:
parent
f845ed2375
commit
b67182258c
@ -119,8 +119,12 @@ image_copyout(int fd)
|
||||
}
|
||||
}
|
||||
free(buffer);
|
||||
if (error)
|
||||
return (error);
|
||||
ofs = lseek(fd, 0L, SEEK_CUR);
|
||||
ftruncate(fd, ofs);
|
||||
if (ofs == -1)
|
||||
return (errno);
|
||||
error = (ftruncate(fd, ofs) == -1) ? errno : 0;
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user