mirror of
https://github.com/owntone/owntone-server.git
synced 2025-07-08 08:32:22 -04:00
[worker] Make sure worker accepts NULL-arguments
This commit is contained in:
parent
7f7207bb87
commit
061beaf272
@ -149,6 +149,8 @@ worker_execute(void (*cb)(void *), void *cb_arg, size_t arg_size, int delay)
|
||||
return;
|
||||
}
|
||||
|
||||
if (arg_size > 0)
|
||||
{
|
||||
argcpy = malloc(arg_size);
|
||||
if (!argcpy)
|
||||
{
|
||||
@ -158,6 +160,9 @@ worker_execute(void (*cb)(void *), void *cb_arg, size_t arg_size, int delay)
|
||||
}
|
||||
|
||||
memcpy(argcpy, cb_arg, arg_size);
|
||||
}
|
||||
else
|
||||
argcpy = NULL;
|
||||
|
||||
cmdarg->cb = cb;
|
||||
cmdarg->cb_arg = argcpy;
|
||||
|
Loading…
x
Reference in New Issue
Block a user