tools: fix static code analysis
-Possible memory leak glob
@@ -462,6 +462,7 @@ fpga_result find_dev_feature(fpga_token token,
if (gres) {
OPAE_ERR("Failed pattern match %s: %s",
feature_path, strerror(errno));
+ if (pglob.gl_pathv)
globfree(&pglob);
return FPGA_NOT_FOUND;
}
@@ -496,7 +497,8 @@ fpga_result find_dev_feature(fpga_token token,
}
free:
- if (gres)
+ if (pglob.gl_pathv)
globfree(&pglob);
+
return res;
}
\ No newline at end of file
