Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
imagecache: coverity - fix wrong unlink() call
  • Loading branch information
perexg committed Oct 3, 2014
1 parent a7e6993 commit 07d5b11
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/imagecache.c
Expand Up @@ -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;
Expand Down Expand Up @@ -215,7 +215,8 @@ imagecache_image_fetch ( imagecache_image_t *img )
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;
Expand Down

0 comments on commit 07d5b11

Please sign in to comment.