test: ipc: unixsocket: Close open fds on error paths
Reported-by: Coverity CID=279099 Signed-off-by: Umang Jain <email@uajain.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
6b88163343
commit
02018a7d02
1 changed files with 2 additions and 0 deletions
|
@ -146,6 +146,7 @@ private:
|
|||
|
||||
if (num < 0) {
|
||||
cerr << "Read failed" << endl;
|
||||
close(outfd);
|
||||
stop(-EIO);
|
||||
return;
|
||||
} else if (!num)
|
||||
|
@ -153,6 +154,7 @@ private:
|
|||
|
||||
if (write(outfd, buf, num) < 0) {
|
||||
cerr << "Write failed" << endl;
|
||||
close(outfd);
|
||||
stop(-EIO);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue