[libcamera-devel] [PATCH] libcamera: proxy: linux: Initialise pointer members at construction time

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sun Sep 15 13:18:20 CEST 2019


If the IPAProxyLinux constructor fails to locate the proxy worker, the
socket_ and proc_ member pointers will be left uninitialised, leading
the a crash in the destructor. Initialise them both to nullptr.

Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 src/libcamera/proxy/ipa_proxy_linux.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/libcamera/proxy/ipa_proxy_linux.cpp b/src/libcamera/proxy/ipa_proxy_linux.cpp
index 2a3872fdd52a..553714886f62 100644
--- a/src/libcamera/proxy/ipa_proxy_linux.cpp
+++ b/src/libcamera/proxy/ipa_proxy_linux.cpp
@@ -38,6 +38,7 @@ private:
 };
 
 IPAProxyLinux::IPAProxyLinux(IPAModule *ipam)
+	: proc_(nullptr), socket_(nullptr)
 {
 	LOG(IPAProxy, Debug)
 		<< "initializing dummy proxy: loading IPA from "
-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list