Memory leak fixes
This commit is contained in:
parent
5de36b3ecc
commit
cacdfc3534
2 changed files with 7 additions and 1 deletions
|
|
@ -392,6 +392,10 @@ for date format");
|
|||
void ttail_free(ttail_t* t)
|
||||
{
|
||||
size_t i;
|
||||
if(t->flag & TTAIL_FLAG_PREFIX && t->prefix_sz < 0)
|
||||
{
|
||||
regfree(&(t->date_prefix));
|
||||
}
|
||||
for(i=0; i<t->logfile_sz; i++)
|
||||
{
|
||||
if(t->logfile[i])
|
||||
|
|
@ -403,6 +407,8 @@ void ttail_free(ttail_t* t)
|
|||
free(t->logfile_name[i]);
|
||||
}
|
||||
}
|
||||
free(t->logfile);
|
||||
free(t->logfile_name);
|
||||
t->logfile_sz = 0;
|
||||
if(t->fmt != NULL)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ void setup_closest_fileinit(void)
|
|||
|
||||
void teardown_closest_fileinit(void)
|
||||
{
|
||||
teardown_closest();
|
||||
_ttail_search_file_free(ttail);
|
||||
teardown_closest();
|
||||
}
|
||||
|
||||
START_TEST (test_search_closest_init)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue