summaryrefslogtreecommitdiff
path: root/plugins/artwork
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-05-22 11:47:12 +0200
committerGravatar waker <wakeroid@gmail.com>2011-05-22 11:47:12 +0200
commit89746d84af75e6454e647385856a8cf103da0321 (patch)
treec269532e90c7f4cce4b2ee6540b6f98639bb63ea /plugins/artwork
parentaeef33484100c71454cdcd1331b49ac1ee344ade (diff)
added null-ptr checks to artwork queue_pop
Diffstat (limited to 'plugins/artwork')
-rw-r--r--plugins/artwork/artwork.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c
index 3b2663d1..c2a8b766 100644
--- a/plugins/artwork/artwork.c
+++ b/plugins/artwork/artwork.c
@@ -141,10 +141,18 @@ void
queue_pop (void) {
deadbeef->mutex_lock (mutex);
cover_query_t *next = queue ? queue->next : NULL;
- free (queue->fname);
- free (queue->artist);
- free (queue->album);
- free (queue);
+ if (queue) {
+ if (queue->fname) {
+ free (queue->fname);
+ }
+ if (queue->artist) {
+ free (queue->artist);
+ }
+ if (queue->album) {
+ free (queue->album);
+ }
+ free (queue);
+ }
queue = next;
if (!queue) {
queue_tail = NULL;