lib/base log_file should free filename in all cases

once we've used the filename we built, free it before exit
This commit is contained in:
Daria Phoebe Brashear
2020-03-05 18:58:41 -05:00
committed by Nico Williams
parent 59d132f825
commit c295233648

View File

@@ -234,13 +234,13 @@ log_file(heim_context context, const char *timestr, const char *msg, void *data)
if (heim_expand_path_tokens(context, f->filename, 1, &filename, NULL))
return;
fd = open(filename, flags, 0666);
free(filename);
if (fd == -1) {
if (f->disp == FILEDISP_IFEXISTS)
gettimeofday(&f->tv, NULL);
return;
}
f->fd = fdopen(fd, f->mode);
free(filename);
}
if (f->fd == NULL)
return;