Files
reactos/dll
Hermès Bélusca-Maïto 0f9cdb395a [RPCRT4] Better handle buffers reallocation failure case (#8461)
Addendum to commit 7f1075986f (PR #8305).
Addresses review comment https://github.com/reactos/reactos/pull/8305#discussion_r2505628716

In `expand_pointer_table_if_necessary()`, if any of the `RefIdToPointer`
`XlatTable` or `StateTable` buffers failed to be reallocated, the
`realloc()` call would return NULL while the underlying buffer still be
valid. Directly assigning the reallocation result to the pointers would
then leak the buffers.

With this fix, the `realloc()` result is stored in a temporary pointer.
If the result is NULL, we free the original buffer, since the intended
code behaviour is to reset all the tables. If the result is a valid
pointer to the reallocated buffer, then we can use it instead.
2025-11-17 13:21:43 +01:00
..