#vulnerable code 
                                private void load() throws IOException
    {
        if ( !knownHosts.exists() )
        {
            return;
        }

        assertKnownHostFileReadable();

        BufferedReader reader = new BufferedReader( new FileReader( knownHosts ) );
        String line;
        while ( (line = reader.readLine()) != null )
        {
            if ( (!line.trim().startsWith( "#" )) )
            {
                String[] strings = line.split( " " );
                if ( strings[0].trim().equals( serverId ) )
                {
                    // load the certificate
                    fingerprint = strings[1].trim();
                    return;
                }
            }
        }
        reader.close();
    } 
                            #location 20 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                private void load() throws IOException
    {
        if ( !knownHosts.exists() )
        {
            return;
        }

        assertKnownHostFileReadable();

        try ( BufferedReader reader = new BufferedReader( new FileReader( knownHosts ) ) )
        {
            String line;
            while ( (line = reader.readLine()) != null )
            {
                if ( (!line.trim().startsWith( "#" )) )
                {
                    String[] strings = line.split( " " );
                    if ( strings[0].trim().equals( serverId ) )
                    {
                        // load the certificate
                        fingerprint = strings[1].trim();
                        return;
                    }
                }
            }
        }
    }