mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-20 08:56:56 -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
|
|
@ -198,8 +198,7 @@ static void object_destroy(struct object *o)
|
|||
spa_list_remove(&o->link);
|
||||
if (o->proxy)
|
||||
pw_proxy_destroy(o->proxy);
|
||||
if (o->props)
|
||||
pw_properties_free(o->props);
|
||||
pw_properties_free(o->props);
|
||||
clear_params(&o->param_list, SPA_ID_INVALID);
|
||||
clear_params(&o->pending_list, SPA_ID_INVALID);
|
||||
free(o->type);
|
||||
|
|
@ -1290,8 +1289,7 @@ static void registry_event_global(void *data, uint32_t id,
|
|||
|
||||
bind_failed:
|
||||
pw_log_error("can't bind object for %u %s/%d: %m", id, type, version);
|
||||
if (o->props)
|
||||
pw_properties_free(o->props);
|
||||
pw_properties_free(o->props);
|
||||
free(o);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue