mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-09 13:39:47 -05:00
[artwork] Fix memleak on pipe artwork error
This commit is contained in:
@@ -1549,10 +1549,7 @@ source_item_pipe_get(struct artwork_ctx *ctx)
|
|||||||
|
|
||||||
queue_item = db_queue_fetch_byfileid(ctx->id);
|
queue_item = db_queue_fetch_byfileid(ctx->id);
|
||||||
if (!queue_item || !queue_item->artwork_url || strncmp(queue_item->artwork_url, proto, strlen(proto)) != 0)
|
if (!queue_item || !queue_item->artwork_url || strncmp(queue_item->artwork_url, proto, strlen(proto)) != 0)
|
||||||
{
|
goto notfound;
|
||||||
free_queue_item(queue_item, 0);
|
|
||||||
return ART_E_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
path = queue_item->artwork_url + strlen(proto);
|
path = queue_item->artwork_url + strlen(proto);
|
||||||
|
|
||||||
@@ -1560,15 +1557,16 @@ source_item_pipe_get(struct artwork_ctx *ctx)
|
|||||||
// been updated yet. In that case just stop now.
|
// been updated yet. In that case just stop now.
|
||||||
ret = access(path, F_OK);
|
ret = access(path, F_OK);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
{
|
goto notfound;
|
||||||
return ART_E_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
snprintf(ctx->path, sizeof(ctx->path), "%s", path);
|
snprintf(ctx->path, sizeof(ctx->path), "%s", path);
|
||||||
|
|
||||||
free_queue_item(queue_item, 0);
|
free_queue_item(queue_item, 0);
|
||||||
|
|
||||||
return artwork_get(ctx->evbuf, ctx->path, NULL, false, ctx->data_kind, ctx->req_params);
|
return artwork_get(ctx->evbuf, ctx->path, NULL, false, ctx->data_kind, ctx->req_params);
|
||||||
|
|
||||||
|
notfound:
|
||||||
|
free_queue_item(queue_item, 0);
|
||||||
|
return ART_E_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|||||||
Reference in New Issue
Block a user