mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fix a potential memory leak in Debug function
This commit is contained in:
parent
718dc19345
commit
2390625732
1 changed files with 2 additions and 2 deletions
|
@ -160,7 +160,7 @@ int TraceState::LogTrace(const char* fmt, ...) {
|
||||||
|
|
||||||
if ( ! loc.filename ) {
|
if ( ! loc.filename ) {
|
||||||
static constexpr const char str[] = "<no filename>";
|
static constexpr const char str[] = "<no filename>";
|
||||||
loc.filename = util::copy_string(str, std::size(str) - 1);
|
loc.filename = str;
|
||||||
loc.last_line = 0;
|
loc.last_line = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -679,7 +679,7 @@ string get_context_description(const Stmt* stmt, const Frame* frame) {
|
||||||
loc = *stmt->GetLocationInfo();
|
loc = *stmt->GetLocationInfo();
|
||||||
else {
|
else {
|
||||||
static constexpr const char str[] = "<no filename>";
|
static constexpr const char str[] = "<no filename>";
|
||||||
loc.filename = util::copy_string(str, std::size(str) - 1);
|
loc.filename = str;
|
||||||
loc.last_line = 0;
|
loc.last_line = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue