mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
Use pa_hashmap_remove_and_free() where appropriate
This commit is contained in:
parent
14e2553185
commit
eca082a93f
14 changed files with 29 additions and 84 deletions
|
|
@ -129,16 +129,10 @@ const char *pa_headerlist_gets(pa_headerlist *p, const char *key) {
|
|||
}
|
||||
|
||||
int pa_headerlist_remove(pa_headerlist *p, const char *key) {
|
||||
struct header *hdr;
|
||||
|
||||
pa_assert(p);
|
||||
pa_assert(key);
|
||||
|
||||
if (!(hdr = pa_hashmap_remove(MAKE_HASHMAP(p), key)))
|
||||
return -1;
|
||||
|
||||
header_free(hdr);
|
||||
return 0;
|
||||
return pa_hashmap_remove_and_free(MAKE_HASHMAP(p), key);
|
||||
}
|
||||
|
||||
const char *pa_headerlist_iterate(pa_headerlist *p, void **state) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue