RFR: 8362611: [GCC static analyzer] memory leak in ps_core.c core_handle_note
David Holmes
dholmes at openjdk.org
Mon Jul 21 07:33:42 UTC 2025
On Sat, 19 Jul 2025 18:08:03 GMT, Lei Zhu <duke at openjdk.org> wrote:
> Free the `buf` before the early return.
Changes requested by dholmes (Reviewer).
src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c line 290:
> 288: print_error("failed to handle NT_PRSTATUS note\n");
> 289: free(buf);
> 290: return false;
That works, but seems to me that, following the style of the code above, these two lines should be replaced by `goto err;`
-------------
PR Review: https://git.openjdk.org/jdk/pull/26403#pullrequestreview-3036885424
PR Review Comment: https://git.openjdk.org/jdk/pull/26403#discussion_r2218407265
More information about the serviceability-dev
mailing list