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:
Peter Hutterer 2021-06-01 11:21:17 +10:00 committed by Wim Taymans
parent a1e821c259
commit e0471c6757
68 changed files with 142 additions and 273 deletions

View file

@ -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;
}

View file

@ -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;