Skip to content

test: test_rtmp_send_batch leaks the RTMP channel packets (LeakSanitizer, valgrind) #3401

Closed

Description

@vpacher

What happens

test_rtmp_send_batch (#3375) leaks what RTMP_SendPacket() keeps per channel, once in each of its 4 cases:

Direct leak of 128 byte(s) in 1 object(s) allocated from:
    #0 realloc
    #1 RTMP_SendPacket plugins/obs-outputs/librtmp/rtmp.c:4121
    #2 send_one test/cmocka/test_rtmp_send_batch.c:52

and 48 bytes indirect from rtmp.c:4339. The asan job reports it (run 41287610997) and valgrind does too (exit 99, 4 × 176 bytes definitely lost). Tier 2 passes, as it does not check for leaks.

OBS itself does not leak: RTMP_Close() frees m_vecChannelsOut, and rtmp-stream calls it whenever it disconnects (rtmp-stream.c.h). The test calls only RTMP_Free(), which frees the struct and its TLS state, not the channels.

What to do

Call RTMP_Close() before RTMP_Free() in send_one(). With the socket already set to -1 it sends nothing. No assertion changes.

Once #3290 lands, the asan job fails on a sanitizer report, so this must be fixed first.

Activity

  1. added
    quality
    P2
    on Nov 1, 2026
  2. vpacher commented on Nov 1, 2026

    @vpacher
    MemberAuthor

    /ready

  3. added
    ready
    on Nov 1, 2026
  4. vpacher commented on Nov 1, 2026

    @vpacher
    MemberAuthor

    Claiming: close the RTMP connection in test_rtmp_send_batch

    Plan (one PR): call RTMP_Close() before RTMP_Free() in send_one(); valgrind evidence before and after. PR within the hour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2qualityreadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions