mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +00:00
Fixing memory (and CPU) leak in log writer.
There was larger bug with remote logging when local writing was disabled, as in the cluster. Also fixing a number of smaller "potential" leaks.
This commit is contained in:
parent
e738af73a0
commit
eb508fae52
3 changed files with 68 additions and 22 deletions
|
@ -47,6 +47,7 @@ bool LogWriter::Write(int arg_num_fields, LogVal** vals)
|
|||
DBG_LOG(DBG_LOGGING, "Number of fields don't match in LogWriter::Write() (%d vs. %d)",
|
||||
arg_num_fields, num_fields);
|
||||
|
||||
DeleteVals(vals);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -56,6 +57,7 @@ bool LogWriter::Write(int arg_num_fields, LogVal** vals)
|
|||
{
|
||||
DBG_LOG(DBG_LOGGING, "Field type doesn't match in LogWriter::Write() (%d vs. %d)",
|
||||
vals[i]->type, fields[i]->type);
|
||||
DeleteVals(vals);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -146,8 +148,7 @@ void LogWriter::Error(const char *msg)
|
|||
|
||||
void LogWriter::DeleteVals(LogVal** vals)
|
||||
{
|
||||
for ( int i = 0; i < num_fields; i++ )
|
||||
delete vals[i];
|
||||
log_mgr->DeleteVals(num_fields, vals);
|
||||
}
|
||||
|
||||
bool LogWriter::RunPostProcessor(string fname, string postprocessor,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue