mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -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
|
|
@ -119,8 +119,7 @@ static int client_session_link_update(void *object,
|
|||
: 0;
|
||||
|
||||
no_mem:
|
||||
if (props)
|
||||
pw_properties_free(props);
|
||||
pw_properties_free(props);
|
||||
free(link);
|
||||
pw_log_error(NAME" %p: cannot update link: no memory", this);
|
||||
pw_resource_error(this->resource, -ENOMEM,
|
||||
|
|
@ -203,8 +202,7 @@ static void *create_object(void *data,
|
|||
return this;
|
||||
|
||||
no_mem:
|
||||
if (properties)
|
||||
pw_properties_free(properties);
|
||||
pw_properties_free(properties);
|
||||
if (this && this->resource)
|
||||
pw_resource_destroy(this->resource);
|
||||
free(this);
|
||||
|
|
|
|||
|
|
@ -350,6 +350,5 @@ void endpoint_link_clear(struct endpoint_link *this)
|
|||
free(this->info.error);
|
||||
free(this->info.params);
|
||||
|
||||
if (this->props)
|
||||
pw_properties_free(this->props);
|
||||
pw_properties_free(this->props);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -325,6 +325,5 @@ void session_clear(struct session *this)
|
|||
|
||||
free(this->info.params);
|
||||
|
||||
if (this->props)
|
||||
pw_properties_free(this->props);
|
||||
pw_properties_free(this->props);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue