From 79d9528ddca1dfe2dd99287dc88fd7c2b30f7137 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 22 May 2020 06:50:23 +0900 Subject: Fixed potential memory leak Create a wrapper object first, then buffer allocation which can fail. --- lib/rubygems/installer.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb index cf676854dc..cce2967cfd 100644 --- a/lib/rubygems/installer.rb +++ b/lib/rubygems/installer.rb @@ -189,6 +189,7 @@ class Gem::Installer if options[:user_install] @gem_home = Gem.user_dir @bin_dir = Gem.bindir gem_home unless options[:bin_dir] + @plugins_dir = Gem.plugindir(gem_home) check_that_user_bin_dir_is_in_path end end -- cgit v1.2.3