Repository navigation
libobs: Free an empty default sink name in get_default_id - #417
Merged
Merged
Conversation
pulseaudio-wrapper.c runs against a fake libpulse defined in the test, which reports the default sink the test picks. Refs #158
The bstrdup copy of the server's default sink name was freed only when it was non-empty, so every device check on a box with no default sink leaked it. Closes #158
Refs #158 Local-Gate: v1 tree=68bdf02490cacbf5b6d28aabe253bb65bfd03412 secs=139 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791852329,"gate":"rust/all/fmt","host":"linux-x86_64","key":"708a09fd51cdde64923fa4d32d10ebbde3e356cebec931f05905039c0a4138b4","lane":"lint","parents":["09c990874b9837349b57708f2c6a58f1ddafaabc"],"secs":16,"stamp":"d408d6b221eb7a80136a231d124f9146","tree":"68bdf02490cacbf5b6d28aabe253bb65bfd03412","v":1,"via":"run"} Ci-Attestation: {"at":1791852329,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"708a09fd51cdde64923fa4d32d10ebbde3e356cebec931f05905039c0a4138b4","lane":"lint","parents":["09c990874b9837349b57708f2c6a58f1ddafaabc"],"secs":16,"stamp":"1c16486c892358c7b04fb5b06d0f69e2","tree":"68bdf02490cacbf5b6d28aabe253bb65bfd03412","v":1,"via":"run"} Ci-Attestation: {"at":1791852329,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"63ff3cedd96eb0d302b579b0ffdbd1b54dd22f68b883736bbe1331c5f99f2ae8","lane":"rust-test","parents":["09c990874b9837349b57708f2c6a58f1ddafaabc"],"secs":58,"stamp":"d97306f8ce78e82fa6185dd6f645d4e2","tree":"68bdf02490cacbf5b6d28aabe253bb65bfd03412","v":1,"via":"run"} Ci-Attestation: {"at":1791852329,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"dbec523e698d18813f25ff1eaaad39754e5c0108bfbc4ffe70677d88862d20c9","lane":"tier2-linux","parents":["09c990874b9837349b57708f2c6a58f1ddafaabc"],"secs":64,"stamp":"bad0b1ac8829fff11083696d6b3d27d7","tree":"68bdf02490cacbf5b6d28aabe253bb65bfd03412","v":1,"via":"run"}
Member
Author
|
Correction: the first push went out with a clang-format violation in the new test, so it was not stamped despite what the description said. It's fixed in a follow-up commit ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #158.
get_default_id()(libobs/audio-monitoring/pulse/pulseaudio-wrapper.c) freed thebstrdupcopy of the server's default sink name only on the non-empty branch. With no default sink (no sinks, a headless or CI box, a removed null sink), everydevices_match()call leaked it: once on source creation and once per device change.test_pulse_default_id. It compilespulseaudio-wrapper.cagainst a fake libpulse defined in the test (pulse headers only, no libpulse link, no sound server). The fake context is always ready and reports the default sink the test picks. The test comparesbnum_allocs()aroundget_default_id+bfree: the named-sink case was 0, the empty-sink case leaked 1.bfree(pdo->default_sink_name)after both branches (bfreeis NULL-safe).Tier 2: 138/138 pass with
ENABLE_RUST_LIBOBSOFF and ON. The local gate passed and is stamped.