summaryrefslogtreecommitdiff
path: root/src/libcamera/device_enumerator_udev.cpp
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-08-02 21:36:23 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-08-03 10:58:50 +0200
commit108b6a8a15487b982612f34bd7b00e7b05be864a (patch)
treef16962e89bee2661b13f50cc2b6495927cf21e11 /src/libcamera/device_enumerator_udev.cpp
parentf0f297c5f26d2e87b9ce819973beac47f361c7ee (diff)
libcamera: device_enumerator_udev: Initialize monitor_ and notifier_ to nullptr
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 <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <email@uajain.com>
Diffstat (limited to 'src/libcamera/device_enumerator_udev.cpp')
-rw-r--r--src/libcamera/device_enumerator_udev.cpp2
1 files changed, 1 insertions, 1 deletions
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)
{
}