Files
Bruno Postle f16ba3d26e Fix leak of entities on duplicate #id
byid_.insert() at IfcParse.cpp is a no-op when the id already exists
(unlike operator[], it doesn't overwrite), even though the adjacent
log message claims the entity is being overwritten. The newly
instantiated duplicate-id entity was therefore never stored anywhere
and leaked.

It can't simply be deleted on insert failure: by that point it's
already been registered in byguid_ (if IfcRoot) and bytype_excl_'s
per-type aggregate, both earlier in the same loop iteration, so
discarding it would leave those maps holding dangling pointers.
Route it into a new owned list instead (same pattern already used
for read_simple_type_instances) so it stays alive for the file's
lifetime but still gets freed on destruction.

Found by fuzzing (fuzzer-3su); repro is crashes/0f486942362e in the
fuzzer repo, minimized to 2 duplicate-id entities out of ~256 total.

Generated with the assistance of an AI coding tool.
2026-07-21 22:22:46 +01:00
..
2026-07-18 22:39:33 +05:00
2026-07-15 19:20:17 +05:00
2026-02-27 14:52:55 +05:00
2026-07-18 22:39:33 +05:00