From 6d3cb459dc07ae6abfacd167d1d282457c2cd1b6 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Tue, 24 Oct 2023 07:34:05 +0000 Subject: [PATCH] 8318591: avoid leaks in loadlib_aix.cpp reload_table() Reviewed-by: mdoerr, lucy --- src/hotspot/os/aix/loadlib_aix.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hotspot/os/aix/loadlib_aix.cpp b/src/hotspot/os/aix/loadlib_aix.cpp index 3a71a78e45c..bc71ca2e310 100644 --- a/src/hotspot/os/aix/loadlib_aix.cpp +++ b/src/hotspot/os/aix/loadlib_aix.cpp @@ -225,6 +225,7 @@ static bool reload_table() { lm->path = g_stringlist.add(ldi->ldinfo_filename); if (!lm->path) { trcVerbose("OOM."); + free(lm); goto cleanup; } @@ -246,6 +247,7 @@ static bool reload_table() { lm->member = g_stringlist.add(p_mbr_name); if (!lm->member) { trcVerbose("OOM."); + free(lm); goto cleanup; } } else {