mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-28 08:01:26 +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
27f771566d
commit
fc80f096e4
@ -74,6 +74,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