#fixed code
                                public void init()
    {
        try
        {
            init( Thread.currentThread().getContextClassLoader().getResourceAsStream( "sampledb.sql" ) );
        }
        catch ( Exception e )
        {
            throw new RuntimeException( e );
        }
        // this doesn't seem to work yet. It reads a partial line and throws up
//        try
//        {
//            init( new GZIPInputStream( new URL( remoteData ).openStream() ) );
//        }
//        catch ( Exception e )
//        {
//            e.printStackTrace();
//        }
    }
#vulnerable code 
                                public void init() throws IOException
    {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream( "sampledb.sql" );
        BufferedReader reader = new BufferedReader( new InputStreamReader( is ) );
        String line = null;
        while ( ( line = reader.readLine() ) != null )
        {
            String type = line.replaceFirst( "INSERT INTO ([^(]+).*", "$1" );
            String[] values = line.replaceFirst( ".*VALUES\\((.*)\\)", "$1" ).split( ", " );
            if ("User".equalsIgnoreCase( type ))
            {
                newUser( toLong( values[ 0 ] ), toStr( values[ 1 ] ) );
            }
            else if ("Friend".equalsIgnoreCase( type ))
            {
                newFriend( toLong( values[ 0 ] ), toLong( values[ 1 ] ) );
            }
            else if ("Artist".equalsIgnoreCase( type ))
            {
                newArtist( toLong( values[ 0 ] ), toStr( values[ 1 ] ) );
            }
            else if ("Fan".equalsIgnoreCase( type ))
            {
                newFan( toLong( values[ 0 ] ), toLong( values[ 1 ] ) );
            }
            else if ("Album".equalsIgnoreCase( type ))
            {
                newAlbum( toLong( values[ 0 ] ), toStr( values[ 1 ] ), toLong( values[ 2 ] ), new Integer( values[ 3 ].trim() ) );
            }
            else if ("Song".equalsIgnoreCase( type ))
            {
                newSong( toLong( values[ 0 ] ), toStr( values[ 1 ] ), toLong( values[ 2 ] ), toLong( values[ 3 ] ) );
            }
        }

        is.close();

    } 
                            #location 13 
                            #vulnerability type RESOURCE_LEAK