#vulnerable code 
                              private void createJarFromClassPathResources(final FileOutputStream fos,
      final String location) throws IOException {
    final Manifest m = new Manifest();

    m.clear();
    final Attributes global = m.getMainAttributes();
    if (global.getValue(Attributes.Name.MANIFEST_VERSION) == null) {
      global.put(Attributes.Name.MANIFEST_VERSION, "1.0");
    }
    final File mylocation = new File(location);
    global.putValue(BOOT_CLASSPATH, getBootClassPath(mylocation));
    global.putValue(PREMAIN_CLASS, AGENT_CLASS_NAME);
    global.putValue(AGENT_CLASS, AGENT_CLASS_NAME);    
    global.putValue(CAN_REDEFINE_CLASSES, "true");
    global.putValue(CAN_RETRANSFORM_CLASSES, "true");
    global.putValue(CAN_SET_NATIVE_METHOD, "true");

    final JarOutputStream jos = new JarOutputStream(fos, m);
    addClass(Agent.class, jos);
    addClass(CodeCoverageStore.class, jos);
    addClass(InvokeReceiver.class, jos);
    jos.close();
  } 
                            #location 9 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              private void createJarFromClassPathResources(final FileOutputStream fos,
      final String location) throws IOException {
    final Manifest m = new Manifest();

    m.clear();
    final Attributes global = m.getMainAttributes();
    if (global.getValue(Attributes.Name.MANIFEST_VERSION) == null) {
      global.put(Attributes.Name.MANIFEST_VERSION, "1.0");
    }
    final File mylocation = new File(location);
    global.putValue(BOOT_CLASSPATH, getBootClassPath(mylocation));
    global.putValue(PREMAIN_CLASS, AGENT_CLASS_NAME);
    global.putValue(AGENT_CLASS, AGENT_CLASS_NAME);    
    global.putValue(CAN_REDEFINE_CLASSES, "true");
    global.putValue(CAN_RETRANSFORM_CLASSES, "true");
    global.putValue(CAN_SET_NATIVE_METHOD, "true");

    try(JarOutputStream jos = new JarOutputStream(fos, m)) {
      addClass(Agent.class, jos);
      addClass(CodeCoverageStore.class, jos);
      addClass(InvokeReceiver.class, jos);
    }
  }