Fix static analysis issue 80/271580/1
authorIlho Kim <ilho159.kim@samsung.com>
Wed, 23 Feb 2022 06:38:43 +0000 (15:38 +0900)
committerIlho Kim <ilho159.kim@samsung.com>
Wed, 23 Feb 2022 06:38:43 +0000 (15:38 +0900)
Fix unchecked return value

Change-Id: I0537dd92eb24034e273025bce52cd999c17abf77
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/common/plugins/plugin_list_parser.cc

index 7b8d82f..aa3490b 100644 (file)
@@ -78,10 +78,9 @@ bool PluginsListParser::ValidPath(const std::string& path) {
 std::string PluginsListParser::ExtractRaw(const std::string& data,
                                           const std::regex& re_extract) {
   std::smatch match;
-  std::regex_search(data, match, re_extract);
 
   // 2 mean matched group
-  if (match.size() != 2) {
+  if (!std::regex_search(data, match, re_extract) || match.size() != 2) {
     LOG(ERROR) << "Could not find data during extracting parameter";
     return {};
   }