Skip to content

rtspd: fix to check realloc() result#20621

Closed
vszakats wants to merge 1 commit intocurl:masterfrom
vszakats:ctidy1
Closed

rtspd: fix to check realloc() result#20621
vszakats wants to merge 1 commit intocurl:masterfrom
vszakats:ctidy1

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented Feb 18, 2026

Also enable bugprone-suspicious-realloc-usage clang-tidy option
to verify.

Fixing:

tests/server/rtspd.c:328:37: error: 'req->rtp_buffer' may be set to null if 'realloc' fails,
 which may result in a leak of the original buffer
 [bugprone-suspicious-realloc-usage,-warnings-as-errors]
  328 |                   req->rtp_buffer = realloc(req->rtp_buffer,
      |                   ~~~~~~~~~~~~~~~   ^       ~~~~~~~~~~~~~~~

Ref: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-realloc-usage.html

Also enable `bugprone-suspicious-realloc-usage` clang-tidy option to
verify.
@vszakats vszakats added the tests label Feb 18, 2026
@vszakats vszakats closed this in 7c01bb2 Feb 19, 2026
@vszakats vszakats deleted the ctidy1 branch February 19, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant