[bug #68192] [long-term] check all dynamic ("heap") memory allocations for success
"G. Branden Robinson" <[email protected]>
| Newsgroups | gmane.comp.printing.groff.bugs |
|---|---|
| Message-ID | <[email protected]> |
Follow-up Comment #10, bug #68192 (group groff): commit ad85cbebff0ec4f754120a10c1519046cf6f2758 Author: G. Branden Robinson <[email protected]> Date: Sun May 31 21:26:06 2026 -0500 [grohtml]: Refactor. (2/2) Be more fastidious with heap-allocated memory. * src/devices/grohtml/output.cpp: Use ISO C++98 exceptions to handle heap storage allocation failures. Preprocessor-include C++ "<new>" header file. (word::word): Slightly refactor. Introduce new local variable `amount` to track the count of `char`s we wish to allocate, so that we can use it both in a `new` allocation and in the fatal diagnostic thrown if that allocation fails. (word::word) (word_list::add_word): Catch `std::bad_alloc` exception and `fatal()` out with an attempt to describe what we were doing. Continues the long process of fixing Savannah #68192. _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?68192> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/
signature.asc
(application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaiRVPwAKCRCqLAuaBUf3 Tp/1AQDdi+QIbCCARv0P6xBLoord1hwOx3Dp1Jpy4P2iWoFRvgEA8nKKuHSwg1ST h/2ocRRv1XD7sjVpdLph92a9THLbXAw= =D1+j -----END PGP SIGNATURE-----