Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-146245: Fix ref/buffer leaks in socketmodule.c on audit hook failure#146247

Closed
kimimgo wants to merge 1 commit intopython:mainfrom
kimimgo:fix/socket-audit-leak-146245
Closed

gh-146245: Fix ref/buffer leaks in socketmodule.c on audit hook failure#146247
kimimgo wants to merge 1 commit intopython:mainfrom
kimimgo:fix/socket-audit-leak-146245

Conversation

@kimimgo
Copy link

@kimimgokimimgo commentedMar 21, 2026
edited by bedevere-appbot
Loading

Fixes#146245

Summary

Two leak bugs insocketmodule.c whenPySys_Audit raises:

1.getaddrinfo (line 6985)

return NULL skipped cleanup ofidna andpstr refs. Changed to
goto err which properly callsPy_XDECREF on both.

2.sock_sendto (line 4811)

return NULL skippedPyBuffer_Release(&pbuf). Added the release
before the return, matching the pattern used in adjacent error paths.

… failureFix two leak bugs in socketmodule.c when PySys_Audit raises:1. getaddrinfo: 'return NULL' replaced with 'goto err' to ensure   idna and pstr refs are properly released via Py_XDECREF.2. sock_sendto: Added PyBuffer_Release(&pbuf) before 'return NULL'   to release the Py_buffer when audit hook raises.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

socketmodule.c: Reference and buffer leaks via audit hook failures

1 participant

@kimimgo

[8]ページ先頭

©2009-2026 Movatter.jp