]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
imagecache: fix the missing ref initialization, fixes #5458
authorJaroslav Kysela <perex@perex.cz>
Wed, 26 Dec 2018 13:26:12 +0000 (14:26 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 26 Dec 2018 13:26:12 +0000 (14:26 +0100)
src/imagecache.c

index 38c84b2c441a609ad6d8825c5afa0cff90b3c87d..b183bbdb202b47c6302a8037ff52c27bb2f82512 100644 (file)
@@ -450,6 +450,7 @@ retry:
       }
       if (img->savepend) {
         img->state = SAVE;
+        imagecache_decref(img);
         goto retry;
       }
       img->state = IDLE;
@@ -504,6 +505,7 @@ imagecache_init ( void )
       if (!(url = htsmsg_get_str(e, "url"))) continue;
       img           = calloc(1, sizeof(imagecache_image_t));
       img->id       = id;
+      img->ref      = 1;
       img->url      = strdup(url);
       img->accessed = htsmsg_get_s64_or_default(e, "accessed", 0);
       img->updated  = htsmsg_get_s64_or_default(e, "updated", 0);