From 568ad1e38207c8d3209cf4094be749a1e58f3c61 Mon Sep 17 00:00:00 2001 From: jcorporation Date: Mon, 5 Nov 2018 20:20:18 +0000 Subject: [PATCH] Fix: calculation of coverimage #72 --- src/mpd_client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mpd_client.c b/src/mpd_client.c index cad1d58..0b017c9 100644 --- a/src/mpd_client.c +++ b/src/mpd_client.c @@ -1495,7 +1495,8 @@ int replacechar(char *str, char orig, char rep) { } int mympd_get_cover(const char *uri, char *cover, int cover_len) { - char *path = strdup(uri); + char *orgpath = strdup(uri); + char *path = orgpath; int len; if (!config.coverimage) { @@ -1528,7 +1529,7 @@ int mympd_get_cover(const char *uri, char *cover, int cover_len) { } else len = snprintf(cover, cover_len, "/assets/coverimage-notavailable.png"); } - free(path); + free(orgpath); return len; }