mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-12 20:53:48 +00:00
common: spice_memdup could accept NULL
(this patch is not to solve a crash fix, but to align with glib API)
This commit is contained in:
parent
551ad336c1
commit
bc9d045760
@ -71,6 +71,10 @@ void *spice_memdup(const void *mem, size_t n_bytes)
|
||||
{
|
||||
void *copy;
|
||||
|
||||
if (mem == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
copy = spice_malloc(n_bytes);
|
||||
memcpy(copy, mem, n_bytes);
|
||||
return copy;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user