#fixed code
                                public static void saveX509Cert( String certStr, File certFile ) throws IOException
    {
        try ( BufferedWriter writer = new BufferedWriter( new FileWriter( certFile ) ) )
        {
            writer.write( BEGIN_CERT );
            writer.newLine();

            writer.write( certStr );
            writer.newLine();

            writer.write( END_CERT );
            writer.newLine();
        }
    }
#vulnerable code 
                                public static void saveX509Cert( String certStr, File certFile ) throws IOException
    {
        BufferedWriter writer = new BufferedWriter( new FileWriter( certFile ) );

        writer.write( BEGIN_CERT );
        writer.newLine();

        writer.write( certStr );
        writer.newLine();

        writer.write( END_CERT );
        writer.newLine();

        writer.close();
    } 
                            #location 15 
                            #vulnerability type RESOURCE_LEAK