From 448393f77ec9e37cb807e8e8d35c1a4877d253d4 Mon Sep 17 00:00:00 2001
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: Sun, 15 Sep 2019 14:14:54 +0300
Subject: libcamera: proxy: linux: Initialise pointer members at construction
 time

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@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
---
 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 83a74250..62fcb529 100644
--- a/src/libcamera/proxy/ipa_proxy_linux.cpp
+++ b/src/libcamera/proxy/ipa_proxy_linux.cpp
@@ -44,6 +44,7 @@ int IPAProxyLinux::init()
 }
 
 IPAProxyLinux::IPAProxyLinux(IPAModule *ipam)
+	: proc_(nullptr), socket_(nullptr)
 {
 	LOG(IPAProxy, Debug)
 		<< "initializing dummy proxy: loading IPA from "
-- 
cgit v1.2.1