#vulnerable code 
                             public T loadAlgorithm(String path) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, SecurityException, InvocationTargetException, NoSuchMethodException {
		String pathToFolder = ClassLoader.getSystemResource("algorithms").getPath();
		
		File file = new File(URLDecoder.decode(pathToFolder + "/" + path, "utf-8"));
		JarFile jar = new JarFile(file);
		
		Manifest man = jar.getManifest();
        Attributes attr = man.getMainAttributes();
        String className = attr.getValue(bootstrapClassTagName);
        
        URL[] url = {file.toURI().toURL()};
        ClassLoader loader = new URLClassLoader(url, algorithmSubclass.getClassLoader());
        
        Class<? extends T> algorithmClass = 
        		Class.forName(className, true, loader).asSubclass(algorithmSubclass);
        
		return algorithmClass.getConstructor().newInstance();
	} 
                            #location 7 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                             public T loadAlgorithm(String path) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, SecurityException, InvocationTargetException, NoSuchMethodException {
		String pathToFolder = ClassLoader.getSystemResource("algorithms").getPath();
		
		File file = new File(URLDecoder.decode(pathToFolder + "/" + path, "utf-8"));
		JarFile jar = new JarFile(file);
		
		Manifest man = jar.getManifest();
        Attributes attr = man.getMainAttributes();
        String className = attr.getValue(bootstrapClassTagName);
        
        URL[] url = {file.toURI().toURL()};
        ClassLoader loader = new URLClassLoader(url, algorithmSubclass.getClassLoader());
        
        Class<? extends T> algorithmClass = 
        		Class.forName(className, true, loader).asSubclass(algorithmSubclass);
        
        jar.close();
        
		return algorithmClass.getConstructor().newInstance();
	}