masaori335 commented on code in PR #10055:
URL: https://github.com/apache/trafficserver/pull/10055#discussion_r1268838507
##########
src/tscore/Layout.cc:
##########
@@ -155,7 +155,8 @@ Layout::Layout(std::string_view const _prefix)
std::string path;
int len;
if (getenv("TS_ROOT") != nullptr) {
- std::string env_path(getenv("TS_ROOT"));
+ const char *const env = getenv("TS_ROOT");
+ std::string env_path(nullptr != env ? env : "");
Review Comment:
(just curious) This `env` can't be nullptr in this `if` block. A fails
positive of clang-analyzer? or it says something else?
I don't have any objection to make clang-analyzer happy, though.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]