#vulnerable code 
                                private void writeAvdConfigFile(File homeDir, Map<String,String> values) throws FileNotFoundException {
        StringBuilder sb = new StringBuilder();

        for (String key : values.keySet()) {
            sb.append(key);
            sb.append("=");
            sb.append(values.get(key));
            sb.append("\r\n");
        }

        File configFile = new File(getAvdDirectory(homeDir), "config.ini");
        PrintWriter out = new PrintWriter(configFile);
        out.print(sb.toString());
        out.flush();
        out.close();
    } 
                            #location 9 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                private void writeAvdConfigFile(File homeDir, Map<String,String> values) throws IOException {
        final File configFile = getAvdConfigFile(homeDir);
        ConfigFileUtils.writeConfigFile(configFile, values);
    }