From: Martin Mares Date: Fri, 13 Feb 2009 23:04:07 +0000 (+0100) Subject: Logging: log_new_file() keeps its own copy of the path. X-Git-Tag: holmes-import~94 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=76f55883d3e964abfa69d1ed211153c398708afc;p=libucw.git Logging: log_new_file() keeps its own copy of the path. --- 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;