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:
committed by
Kieran Bingham
parent
6b88163343
commit
02018a7d02
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user