Coverity-id: 13910
Signed-off-by: Christian Hesse <mail@eworm.de>
return errno;
/* Redirect stdout to lockfile */
return errno;
/* Redirect stdout to lockfile */
- if (dup2(slot->lock_fd, STDOUT_FILENO) == -1)
+ if (dup2(slot->lock_fd, STDOUT_FILENO) == -1) {
+ close(tmp);
/* Generate cache content */
slot->fn();
/* update stat info */
/* Generate cache content */
slot->fn();
/* update stat info */
- if (fstat(slot->lock_fd, &slot->cache_st))
+ if (fstat(slot->lock_fd, &slot->cache_st)) {
+ close(tmp);
- if (dup2(tmp, STDOUT_FILENO) == -1)
+ if (dup2(tmp, STDOUT_FILENO) == -1) {
+ close(tmp);
/* Close the temporary filedescriptor */
if (close(tmp))
/* Close the temporary filedescriptor */
if (close(tmp))