From 108b6a8a15487b982612f34bd7b00e7b05be864a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Sun, 2 Aug 2020 21:36:23 +0200 Subject: libcamera: device_enumerator_udev: Initialize monitor_ and notifier_ to nullptr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The monitor_ and notifier_ pointers are acted on in the destructor if not set to nullptr, the pointers are however first initialized in init() and enumerate(). Avoid acting on uninitialized pointers by initializing them to nullptr in the constructor. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Reviewed-by: Umang Jain --- src/libcamera/device_enumerator_udev.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libcamera/device_enumerator_udev.cpp') diff --git a/src/libcamera/device_enumerator_udev.cpp b/src/libcamera/device_enumerator_udev.cpp index 56ca4dc2..96689daa 100644 --- a/src/libcamera/device_enumerator_udev.cpp +++ b/src/libcamera/device_enumerator_udev.cpp @@ -27,7 +27,7 @@ namespace libcamera { LOG_DECLARE_CATEGORY(DeviceEnumerator) DeviceEnumeratorUdev::DeviceEnumeratorUdev() - : udev_(nullptr) + : udev_(nullptr), monitor_(nullptr), notifier_(nullptr) { } -- cgit v1.2.1