mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 23:25:56 -05:00
[cache] Clear stash if called with called with NULL
This commit is contained in:
parent
1752901529
commit
2e149273e5
@ -1218,7 +1218,7 @@ cache_artwork_stash_impl(void *arg, int *retval)
|
||||
|
||||
cmdarg = arg;
|
||||
|
||||
/* Clear current stash */
|
||||
// Clear current stash
|
||||
if (g_stash.path)
|
||||
{
|
||||
free(g_stash.path);
|
||||
@ -1226,6 +1226,13 @@ cache_artwork_stash_impl(void *arg, int *retval)
|
||||
memset(&g_stash, 0, sizeof(struct stash));
|
||||
}
|
||||
|
||||
// If called with no evbuf then we are done, we just needed to clear the stash
|
||||
if (!cmdarg->evbuf)
|
||||
{
|
||||
*retval = 0;
|
||||
return COMMAND_END;
|
||||
}
|
||||
|
||||
g_stash.size = evbuffer_get_length(cmdarg->evbuf);
|
||||
g_stash.data = malloc(g_stash.size);
|
||||
if (!g_stash.data)
|
||||
|
Loading…
Reference in New Issue
Block a user