mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
hook: don't remove from unitialized list
A lot of code calls spa_hook_remove() from error paths where the hook and therefore the list may not have been initialized. This leads to null-derefences.
This commit is contained in:
parent
b23b0e6125
commit
2394413ec3
2 changed files with 8 additions and 1 deletions
|
|
@ -419,6 +419,12 @@ PWTEST(utils_hook)
|
|||
}
|
||||
pwtest_int_eq(count, 4);
|
||||
pwtest_int_eq(hook_free_count, 4);
|
||||
|
||||
/* remove a zeroed hook */
|
||||
struct spa_hook hook;
|
||||
spa_zero(hook);
|
||||
spa_hook_remove(&hook);
|
||||
|
||||
return PWTEST_PASS;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue