diff --git a/src/imagecache.c b/src/imagecache.c index 3f31daba..f6201605 100644 --- a/src/imagecache.c +++ b/src/imagecache.c @@ -139,7 +139,7 @@ imagecache_image_fetch ( imagecache_image_t *img ) int res = 1, r; FILE *fp = NULL; url_t url; - char tmp[256], path[256]; + char tmp[256] = "", path[256]; tvhpoll_event_t ev; tvhpoll_t *efd = NULL; http_client_t *hc; @@ -215,7 +215,8 @@ error: time(&img->updated); // even if failed (possibly request sooner?) if (res) { img->failed = 1; - unlink(tmp); + if (tmp[0]) + unlink(tmp); tvhlog(LOG_WARNING, "imagecache", "failed to download %s", img->url); } else { img->failed = 0;