mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pipewire: allow NULL pointers in pw_memmap_free()
Just like the real free() we should just ignore a NULL pointer, makes the caller code easier for those instances where properties are optional.
This commit is contained in:
parent
71e0cfb5fa
commit
1d4b24d02b
4 changed files with 18 additions and 16 deletions
|
|
@ -386,8 +386,7 @@ static int impl_node_set_io(void *object, uint32_t id, void *data, size_t size)
|
|||
memid = SPA_ID_INVALID;
|
||||
mem_offset = mem_size = 0;
|
||||
}
|
||||
if (old != NULL)
|
||||
pw_memmap_free(old);
|
||||
pw_memmap_free(old);
|
||||
|
||||
if (this->resource == NULL)
|
||||
return data == NULL ? 0 : -EIO;
|
||||
|
|
@ -706,8 +705,7 @@ static int do_port_set_io(struct impl *impl,
|
|||
memid = SPA_ID_INVALID;
|
||||
mem_offset = mem_size = 0;
|
||||
}
|
||||
if (old != NULL)
|
||||
pw_memmap_free(old);
|
||||
pw_memmap_free(old);
|
||||
|
||||
if (this->resource == NULL)
|
||||
return data == NULL ? 0 : -EIO;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue