From: Joel Rosdahl Date: Mon, 7 Jun 2010 21:19:22 +0000 (+0200) Subject: Only look for .tmp. in basename in traverse_fn X-Git-Tag: v3.0~54 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2bf541d1fe6b740aca0f31d3873679a82b79dd39;p=thirdparty%2Fccache.git Only look for .tmp. in basename in traverse_fn --- diff --git a/cleanup.c b/cleanup.c index cac014c44..97f9f8ecc 100644 --- a/cleanup.c +++ b/cleanup.c @@ -96,7 +96,7 @@ static void traverse_fn(const char *fname, struct stat *st) return; } - if (strstr(fname, ".tmp.") != NULL) { + if (strstr(p, ".tmp.") != NULL) { /* delete any tmp files older than 1 hour */ if (st->st_mtime + 3600 < time(NULL)) { unlink(fname); @@ -105,7 +105,6 @@ static void traverse_fn(const char *fname, struct stat *st) } } - free(p); if (num_files == allocated) {