Commit Graph
2 Commits
Author SHA1 Message Date
Cole Munz 8a5a88e463 fix string leak in cli args_free (#2220)
args_parse zeroed every option's value pointer right before returning, so args_free's NULL check always skipped the free. Even without that, args_free was freeing the address of the caller's static variable (e.g. &ext_vars), not the string it points to.

On Windows (_UNICODE builds) each ARGS_OPT_STRING value is a heap copy from unicode_to_ansi(), so -d, -x, -i, atom-quality-table and module-data args leaked on every run. On non-Windows the value just aliases argv, nothing to free.

Removed the value-clearing loop in args_parse (nothing reads .value after parsing except args_free) and rewrote args_free to walk options->count entries and free the actual string pointers, gated on _UNICODE so it's a no-op elsewhere.
2026-07-06 09:43:47 +02:00
Cole Munz c125ac7fa1 cli: honor -w/--no-warnings for the file-too-large skip message (#2219)
scan_dir() prints "skipping <file> ... because it's larger than N
bytes" unconditionally on both the POSIX and Windows paths, ignoring
ignore_warnings even though every other warning in this file checks
it. Guard both prints the same way the other warnings already are.

Fixes #2137
2026-07-06 09:43:33 +02:00