From c295233648eadf899edd01681b8f6e9827986cf4 Mon Sep 17 00:00:00 2001 From: Daria Phoebe Brashear Date: Thu, 5 Mar 2020 18:58:41 -0500 Subject: [PATCH] lib/base log_file should free filename in all cases once we've used the filename we built, free it before exit --- lib/base/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/base/log.c b/lib/base/log.c index a1ac76052..6b6df2b3c 100644 --- a/lib/base/log.c +++ b/lib/base/log.c @@ -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;