RFR: JDK-8301170: perfMemory_windows.cpp add free_security_attr to early returns

Thomas Stuefe stuefe at openjdk.org
Fri Jan 27 09:35:16 UTC 2023


On Fri, 27 Jan 2023 09:07:19 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> The some functions in perfMemory_windows.cpp seem to miss the free_security_attr
> calls in early returns.

LGTM.

You know, this would be a lot simpler with a little RAII:


struct FreeMe {
   LPSECURITY_ATTRIBUTES const _p;
   FreeMe(LPSECURITY_ATTRIBUTES p): _p(p) {}
   ~FreeMe() { free_security_attr(_p); }
};


and then put it after every make_file_security_attr call.

Up to you though. Patch is fine as it is.

..Thomas

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

Marked as reviewed by stuefe (Reviewer).

PR: https://git.openjdk.org/jdk/pull/12245


More information about the hotspot-runtime-dev mailing list