From 02018a7d0222cefe8e6587deebe607917e20e2a1 Mon Sep 17 00:00:00 2001 From: Umang Jain Date: Fri, 15 May 2020 12:42:52 +0000 Subject: test: ipc: unixsocket: Close open fds on error paths Reported-by: Coverity CID=279099 Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Kieran Bingham --- test/ipc/unixsocket.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/ipc') diff --git a/test/ipc/unixsocket.cpp b/test/ipc/unixsocket.cpp index 4487d27b..9cd07ce8 100644 --- a/test/ipc/unixsocket.cpp +++ b/test/ipc/unixsocket.cpp @@ -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; } -- cgit v1.2.1