Skip to content

Commit

Permalink
[apache#6236] fix(core): fix possible resource leak in BaseCatalog
Browse files Browse the repository at this point in the history
fix  possible resource leak in BaseCatalog.
  • Loading branch information
Abyss-lord committed Jan 15, 2025
1 parent 857a464 commit b669a0b
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,8 @@ public void initAuthorizationPluginInstance(IsolatedClassLoader classLoader) {
LOG.info("Authorization provider is not set!");
return;
}
try {
BaseAuthorization<?> authorization =
BaseAuthorization.createAuthorization(classLoader, authorizationProvider);

// Load the authorization plugin with the class loader of the catalog.
// Because the JDBC authorization plugin may load JDBC driver using the class loader.
try (BaseAuthorization<?> authorization =
BaseAuthorization.createAuthorization(classLoader, authorizationProvider)) {
authorizationPlugin =
classLoader.withClassLoader(
cl ->
Expand Down

0 comments on commit b669a0b

Please sign in to comment.