mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pipewire: allow NULL pointers in pw_properties_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. Patch generated with concinelle with a few manual fixes.
This commit is contained in:
parent
a1e821c259
commit
e0471c6757
68 changed files with 142 additions and 273 deletions
|
|
@ -525,8 +525,7 @@ on_connect(void *data, int fd, uint32_t mask)
|
|||
return;
|
||||
error:
|
||||
pw_log_error(NAME" %p: failed to create client: %m", impl);
|
||||
if (props != NULL)
|
||||
pw_properties_free(props);
|
||||
pw_properties_free(props);
|
||||
if (client != NULL)
|
||||
client_free(client);
|
||||
return;
|
||||
|
|
@ -653,8 +652,7 @@ static void impl_free(struct impl *impl)
|
|||
spa_hook_remove(&impl->module_listener);
|
||||
spa_list_consume(s, &impl->server_list, link)
|
||||
server_free(s);
|
||||
if (impl->props)
|
||||
pw_properties_free(impl->props);
|
||||
pw_properties_free(impl->props);
|
||||
free(impl);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue