RFR: 8342870: Errors related to unused code on Windows after 8339120 in accessibility [v5]

Julian Waters jwaters at openjdk.org
Thu Jan 23 05:48:51 UTC 2025


On Tue, 21 Jan 2025 13:40:42 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Julian Waters has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits:
>> 
>>  - Merge branch 'openjdk:master' into accessibility
>>  - Cast to void in AccessBridgeCalls.c
>>  - static_cast to void in jaccessinspector.cpp
>>  - Formatting changes in AccessBridgeEventHandler.cpp
>>  - Merge branch 'master' into accessibility
>>  - Remove now unused result
>>  - Merge branch 'master' into accessibility
>>  - 8342870
>
> src/jdk.accessibility/windows/native/jabswitch/jabswitch.cpp line 334:
> 
>> 332:         TCHAR dataBuffer[DEFAULT_ALLOC];
>> 333:         TCHAR *data = dataBuffer;
>> 334:      // bool freeData = false;
> 
> This should be set to `true` if `data` is reallocated, otherwise both `regEnable` and `regDeleteValue` leak `data`.
> 
> https://github.com/openjdk/jdk/blob/4a9fba615da0dfa6646ecb9fd9d929f74fe6875e/src/jdk.accessibility/windows/native/jabswitch/jabswitch.cpp#L336-L341
> 
> In fact, the above statement should probably be removed — the following code uses only `dataBuffer` which does not contain any data if the buffer was dynamically allocated and assigned to `data`.

By the above statement are you referring to the lines 336 to 341? I'll admit I'm a little lost for this one

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21656#discussion_r1926398535


More information about the client-libs-dev mailing list