mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-08 13:30:08 -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
|
|
@ -120,8 +120,7 @@ static int client_endpoint_stream_update(void *object,
|
|||
: 0;
|
||||
|
||||
no_mem:
|
||||
if (props)
|
||||
pw_properties_free(props);
|
||||
pw_properties_free(props);
|
||||
free(stream);
|
||||
pw_log_error(NAME" %p: cannot update stream: no memory", this);
|
||||
pw_resource_errorf(this->resource, -ENOMEM,
|
||||
|
|
@ -204,8 +203,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);
|
||||
|
|
|
|||
|
|
@ -333,6 +333,5 @@ void endpoint_stream_clear(struct endpoint_stream *this)
|
|||
free(this->info.link_params);
|
||||
free(this->info.params);
|
||||
|
||||
if (this->props)
|
||||
pw_properties_free(this->props);
|
||||
pw_properties_free(this->props);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -365,6 +365,5 @@ void endpoint_clear(struct endpoint *this)
|
|||
free(this->info.media_class);
|
||||
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