imagecache: coverity - fix wrong unlink() call

This commit is contained in:
Jaroslav Kysela 2014-10-03 14:42:26 +02:00
parent a7e6993c13
commit 07d5b1118e

View file

@ -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;