From 76f55883d3e964abfa69d1ed211153c398708afc Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 14 Feb 2009 00:04:07 +0100 Subject: [PATCH] Logging: log_new_file() keeps its own copy of the path. --- ucw/log-file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ucw/log-file.c b/ucw/log-file.c index 65418a29..6a060baa 100644 --- a/ucw/log-file.c +++ b/ucw/log-file.c @@ -124,6 +124,7 @@ file_close(struct log_stream *ls) if ((ls->udata & FF_CLOSE_FD) && ls->idata >= 0) close(ls->idata); xfree(ls->name); + xfree(ls->pdata); } /* handler for standard files */ @@ -160,7 +161,7 @@ log_new_file(const char *path) { struct log_stream *ls = log_new_stream(); ls->idata = -1; - ls->pdata = (void *) path; + ls->pdata = xstrdup(path); if (strchr(path, '%')) ls->udata = FF_FORMAT_NAME; ls->udata |= FF_CLOSE_FD; -- 2.39.2