diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-11-29 23:38:28 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-12-04 23:05:03 +0200 |
commit | bf26505dc891aa3e32220c05ea671266cb3ef422 (patch) | |
tree | 22117c12a679ab5237ce860b40d3d5e837953a3a | |
parent | 91436688874a2450c7da22527c59e34c2053b9ef (diff) |
libcamera: ipc_unixsocket: Fix file descriptor leak
The file descriptor created for the remote side of the socket is passed
to the forked process, but never closed. Fix the leak.
The fix can be tested by running the unixsocket_ipc unit test under
valgrind with `valgrind --track-fds=yes ./test/ipc/unixsocket_ipc`.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r-- | src/libcamera/ipc_pipe_unixsocket.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcamera/ipc_pipe_unixsocket.cpp b/src/libcamera/ipc_pipe_unixsocket.cpp index 65277500..3ef90709 100644 --- a/src/libcamera/ipc_pipe_unixsocket.cpp +++ b/src/libcamera/ipc_pipe_unixsocket.cpp @@ -38,7 +38,7 @@ IPCPipeUnixSocket::IPCPipeUnixSocket(const char *ipaModulePath, } socket_->readyRead.connect(this, &IPCPipeUnixSocket::readyRead); args.push_back(std::to_string(fd.get())); - fds.push_back(fd.release()); + fds.push_back(fd.get()); proc_ = std::make_unique<Process>(); int ret = proc_->start(ipaProxyWorkerPath, args, fds); |