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:
Peter Hutterer 2021-06-02 15:24:08 +10:00 committed by Wim Taymans
parent 71e0cfb5fa
commit 1d4b24d02b
4 changed files with 18 additions and 16 deletions

View file

@ -457,8 +457,7 @@ client_node_set_io(void *object,
res = spa_node_set_io(data->node->node, id, ptr, size);
if (old != NULL)
pw_memmap_free(old);
pw_memmap_free(old);
exit:
if (res < 0) {
pw_log_error("node %p: set_io: %s", proxy, spa_strerror(res));
@ -809,8 +808,7 @@ client_node_port_set_io(void *object,
activate_mix(data, mix);
}
exit_free:
if (old != NULL)
pw_memmap_free(old);
pw_memmap_free(old);
exit:
if (res < 0) {
pw_log_error("port %p: set_io: %s", mix, spa_strerror(res));