Skip to content

bug: libobs/obs-properties: a file-save path's filter and a replaced button URL are leaked #831

Closed

Description

@zackees

Found while characterizing obs-properties.c (#828, #830).

Location

  1. libobs/obs-properties.c, path_data_free: frees filter only when type == OBS_PATH_FILE, but obs_properties_add_path also stores it for OBS_PATH_FILE_SAVE. Every file-save path property with a filter leaks that string when its properties are destroyed (every time a source's Properties dialog closes, for sources with a save path).
  2. obs_property_button_set_url: data->url = bstrdup(url); without bfree(data->url) first, so calling it twice leaks the first URL.

Class

Memory leak.

Proposed fix and failing test

  1. if (data->type == OBS_PATH_FILE || data->type == OBS_PATH_FILE_SAVE) in path_data_free (or free filter unconditionally: it is NULL otherwise).
  2. bfree(data->url); before the bstrdup.

Failing test: a cmocka test under LeakSanitizer (obs_test_sanitize(... address)) that adds a FILE_SAVE path with a filter, and a button with set_url called twice, then destroys the properties. The Rust port (#828) must not reproduce either leak.

Activity

  1. added
    bug
    on Oct 15, 2026
  2. zackees commented on Oct 15, 2026

    @zackees
    MemberAuthor

    Claiming: fix on branch fix/obs-properties-leaks. Plan: 1) RED test (Rust, leak checks), 2) GREEN fix in Rust port + C. PR within the hour.

  3. added
    claimed
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclaimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions