You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bugfix: Fix temp file resource leak in find_missing.py
Summary:
Both `find_defs()` and `find_decls()` create temporary pattern files in /tmp
using a predictable name with `random.randint(0, 1024)` but never clean them
up after use. This causes temp file accumulation and also risks collisions
due to the small random range (only 1024 possible filenames).
Replaced manual temp file creation with `tempfile.NamedTemporaryFile` for
unique naming, and added `try/finally` blocks to ensure the files are always
cleaned up. Also removed the now-unused `random` import.
Reviewed By: yoney
Differential Revision: D99294378
fbshipit-source-id: e7d194d258ff97b51587dc456dcfa16d5dbc9df7
0 commit comments