mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -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
|
|
@ -497,8 +497,7 @@ do_update_port(struct node *this,
|
|||
}
|
||||
|
||||
if (change_mask & PW_CLIENT_NODE_PORT_UPDATE_INFO) {
|
||||
if (port->properties)
|
||||
pw_properties_free(port->properties);
|
||||
pw_properties_free(port->properties);
|
||||
port->properties = NULL;
|
||||
port->info.props = NULL;
|
||||
port->info.n_params = 0;
|
||||
|
|
@ -1764,8 +1763,7 @@ error_exit_free:
|
|||
error_exit_cleanup:
|
||||
if (resource)
|
||||
pw_resource_destroy(resource);
|
||||
if (properties)
|
||||
pw_properties_free(properties);
|
||||
pw_properties_free(properties);
|
||||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -482,8 +482,7 @@ do_update_port(struct node *this,
|
|||
}
|
||||
|
||||
if (change_mask & PW_CLIENT_NODE0_PORT_UPDATE_INFO) {
|
||||
if (port->properties)
|
||||
pw_properties_free(port->properties);
|
||||
pw_properties_free(port->properties);
|
||||
port->properties = NULL;
|
||||
port->info.props = NULL;
|
||||
port->info.n_params = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue