imagecache: coverity - fix wrong unlink() call
This commit is contained in:
parent
a7e6993c13
commit
07d5b1118e
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue