From 533ee868663b233ffda1796eec19ff38bb5328f4 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Sat, 3 Oct 2026 14:18:59 -0400 Subject: [PATCH] sdrbase: Initialize serial port directory list Initialize namelist before passing it to scandir(). Found by cppcheck. Signed-off-by: Robin Getz --- sdrbase/util/serialutil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdrbase/util/serialutil.cpp b/sdrbase/util/serialutil.cpp index 4eb4d2c50..3b96b54b0 100644 --- a/sdrbase/util/serialutil.cpp +++ b/sdrbase/util/serialutil.cpp @@ -58,7 +58,7 @@ void SerialUtil::getComPorts(std::vector& comPorts, const std::stri void SerialUtil::getComPorts(std::vector& comPorts, const std::string& regexStr) { int n; - struct dirent **namelist; + struct dirent **namelist = nullptr; comPorts.clear(); const char* sysdir = "/sys/class/tty/"; struct stat fileStat;