mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
pw-dump: fix string memory leak on error
`object::type` was not cleared in the error path. Fix that by calling `object_destroy()`, which takes care of it.
This commit is contained in:
parent
bb54e32e8a
commit
3a912cbbb3
1 changed files with 2 additions and 3 deletions
|
|
@ -1329,6 +1329,7 @@ static void registry_event_global(void *data, uint32_t id,
|
||||||
spa_list_init(&o->param_list);
|
spa_list_init(&o->param_list);
|
||||||
spa_list_init(&o->pending_list);
|
spa_list_init(&o->pending_list);
|
||||||
spa_list_init(&o->data_list);
|
spa_list_init(&o->data_list);
|
||||||
|
spa_list_append(&d->object_list, &o->link);
|
||||||
|
|
||||||
o->class = find_class(type, version);
|
o->class = find_class(type, version);
|
||||||
if (o->class != NULL) {
|
if (o->class != NULL) {
|
||||||
|
|
@ -1350,15 +1351,13 @@ static void registry_event_global(void *data, uint32_t id,
|
||||||
} else {
|
} else {
|
||||||
o->changed++;
|
o->changed++;
|
||||||
}
|
}
|
||||||
spa_list_append(&d->object_list, &o->link);
|
|
||||||
|
|
||||||
core_sync(d);
|
core_sync(d);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bind_failed:
|
bind_failed:
|
||||||
pw_log_error("can't bind object for %u %s/%d: %m", id, type, version);
|
pw_log_error("can't bind object for %u %s/%d: %m", id, type, version);
|
||||||
pw_properties_free(o->props);
|
object_destroy(o);
|
||||||
free(o);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue