From patchwork Sun Sep 15 11:18:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1972 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DC71B60BB0 for ; Sun, 15 Sep 2019 13:18:37 +0200 (CEST) Received: from pendragon.ideasonboard.com (85-76-97-146-nat.elisa-mobile.fi [85.76.97.146]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D41ED23F for ; Sun, 15 Sep 2019 13:18:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1568546317; bh=AgM3I3ybZw18ypiwlNLCjEByWAIJczrFDO/CbeFZ1M8=; h=From:To:Subject:Date:From; b=IiIp8hAA6KT6/3NT/vsd2l62vCZr8OUBv0ULyyLlO5XCaUp0/3Yfo6p+CwajQOamU P8++L2eg8JYSFj1LP80QPfbbKGXuxSS89ZW8LuMampGpzXBbX+y58aHxuiwyJslFRW Tw3K2jUWz75BEi2otsUF/sx6WA7BDMAXQWLkKH34= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sun, 15 Sep 2019 14:18:20 +0300 Message-Id: <20190915111820.11762-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: proxy: linux: Initialise pointer members at construction time X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Sep 2019 11:18:38 -0000 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 Reviewed-by: Jacopo Mondi --- 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 "