mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
metadata: free item value as well
This commit is contained in:
parent
2ae4322cca
commit
4de3403c99
1 changed files with 11 additions and 2 deletions
|
|
@ -30,17 +30,26 @@ struct metadata_item {
|
|||
char *value;
|
||||
};
|
||||
|
||||
static void clear_item(struct metadata_item *it)
|
||||
{
|
||||
free(it->key);
|
||||
free(it->type);
|
||||
free(it->value);
|
||||
}
|
||||
|
||||
void remove_all(struct global *global, uint32_t subject, const char *key)
|
||||
{
|
||||
struct metadata_item *it;
|
||||
for (it = pw_array_first(&global->metadata_info.metadata);
|
||||
pw_array_check(&global->metadata_info.metadata, it);) {
|
||||
if (it->subject == subject &&
|
||||
(key == NULL || it->key == NULL || strcmp(key, it->key) == 0))
|
||||
(key == NULL || it->key == NULL || strcmp(key, it->key) == 0)) {
|
||||
clear_item(it);
|
||||
pw_array_remove(&global->metadata_info.metadata, it);
|
||||
else
|
||||
} else {
|
||||
it++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static struct metadata_item *find_item(struct global *global, uint32_t subject,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue