#vulnerable code 
                              private File createTmpScript(String content) throws IOException {
    File res = File.createTempFile(FILE_NAME, ".js");
    BufferedWriter out = new BufferedWriter(new FileWriter(res));
    out.write(content);
    out.close();
    return res;

  } 
                            #location 6 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              private File createTmpScript(String content) throws IOException {
    File res=null;
    if (DEBUG){
      res = new File("/Users/freynaud/Documents/debug.js");
    }else {
      res = File.createTempFile(FILE_NAME, ".js");
    }
   
    Writer writer =  new FileWriter(res);
    IOUtils.copy(IOUtils.toInputStream(content),writer, "UTF-8");
    IOUtils.closeQuietly(writer);
    return res;

  }