Merge "Fix static analysis issue" into tizen
authorSangyoon Jang <jeremy.jang@samsung.com>
Wed, 23 Feb 2022 08:38:59 +0000 (08:38 +0000)
committerGerrit Code Review <gerrit@review>
Wed, 23 Feb 2022 08:38:59 +0000 (08:38 +0000)
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 {};
   }