Since '
1b807f92d' - Coverity complains that in the error paths of
both virFork() and virProcessWait() that the 'passfd' will not be closed.
Added the VIR_FORCE_CLOSE(passfd) and initialized it to -1.
Also noted that variable 'buf' was never really used - so I removed it
const char *binary,
virNetSocketPtr *retsock)
{
- char *buf = NULL;
- int fd, passfd;
+ int fd, passfd = -1;
virSocketAddr localAddr;
virSocketAddr remoteAddr;
return 0;
error:
- VIR_FREE(buf);
VIR_FORCE_CLOSE(fd);
+ VIR_FORCE_CLOSE(passfd);
if (spawnDaemon)
unlink(path);
return -1;