JosiahWI commented on code in PR #13360:
URL: https://github.com/apache/trafficserver/pull/13360#discussion_r3519639906
##########
src/traffic_crashlog/traffic_crashlog.cc:
##########
@@ -145,14 +145,18 @@ crashlog_write_backtrace(FILE *fp, const crashlog_target
&target)
// can also happen without a debugger. Possibly in that case, there is a
race with the
// kernel locking the process information?
- if (mgmterr == 0 && trace != nullptr) {
+ if (mgmterr == 0 && trace != nullptr && trace[0] != '\0') {
// ServerBacktrace succeeded - this gives us backtraces for all threads.
fprintf(fp, "%s", trace);
free(trace);
return true;
}
+ free(trace);
Review Comment:
This is a use case for `free` accepting `nullptr`. Interesting!
--
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]