Program: 152809
Project: 152809
Buggy source:
/** 
 * Parses the credential information from a form submission.
 */
public static UserProvidedCredential fromForm(StaplerRequest req,MultipartFormDataParser parser) throws IOException {
  CrumbIssuer crumbIssuer=Hudson.getInstance().getCrumbIssuer();
  if (crumbIssuer != null && !crumbIssuer.validateCrumb(req,parser)) {
    throw HttpResponses.error(SC_FORBIDDEN,new IOException("String_Node_Str"));
  }
  String kind=parser.get("String_Node_Str");
  int idx=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").indexOf(kind);
  String username=parser.get("String_Node_Str" + idx);
  String password=parser.get("String_Node_Str" + idx);
  Boolean overrideGlobal=Boolean.valueOf(parser.get("String_Node_Str"));
  final File keyFile;
  final FileItem item;
  if (idx <= 1) {
    keyFile=null;
    item=null;
  }
 else {
    item=parser.getFileItem(kind.equals("String_Node_Str") ? "String_Node_Str" : "String_Node_Str");
    keyFile=File.createTempFile("String_Node_Str","String_Node_Str");
    if (item != null) {
      try {
        item.write(keyFile);
      }
 catch (      Exception e) {
        throw new IOException2(e);
      }
      if (PuTTYKey.isPuTTYKeyFile(keyFile)) {
        LOGGER.info("String_Node_Str" + keyFile + "String_Node_Str");
        new PuTTYKey(keyFile,null).toOpenSSH(keyFile);
      }
    }
  }
  return new UserProvidedCredential(username,password,keyFile,overrideGlobal,req.findAncestorObject(AbstractProject.class)){
    @Override public void close() throws IOException {
      if (keyFile != null) {
        keyFile.delete();
      }
      if (item != null) {
        item.delete();
      }
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Parses the credential information from a form submission.
 */
public static UserProvidedCredential fromForm(StaplerRequest req,MultipartFormDataParser parser) throws IOException {
  CrumbIssuer crumbIssuer=Hudson.getInstance().getCrumbIssuer();
  if (crumbIssuer != null && !crumbIssuer.validateCrumb(req,parser)) {
    throw HttpResponses.error(SC_FORBIDDEN,new IOException("String_Node_Str"));
  }
  String kind=parser.get("String_Node_Str");
  int idx=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").indexOf(kind);
  String username=parser.get("String_Node_Str" + idx);
  String password=parser.get("String_Node_Str" + idx);
  Boolean overrideGlobal=Boolean.valueOf(parser.get("String_Node_Str"));
  final File keyFile;
  final FileItem item;
  if (idx <= 1) {
    keyFile=null;
    item=null;
  }
 else {
    item=parser.getFileItem(kind.equals("String_Node_Str") ? "String_Node_Str" : "String_Node_Str");
    keyFile=File.createTempFile("String_Node_Str","String_Node_Str");
    if (item != null) {
      try {
        item.write(keyFile);
      }
 catch (      Exception e) {
        throw new IOException2(e);
      }
      if (PuTTYKey.isPuTTYKeyFile(keyFile)) {
        LOGGER.info("String_Node_Str" + keyFile + "String_Node_Str");
        new PuTTYKey(keyFile,null).toOpenSSH(keyFile);
      }
    }
  }
  return new UserProvidedCredential(username,password,keyFile,overrideGlobal,req.findAncestorObject(AbstractProject.class)){
    @Override public void close() throws IOException {
      boolean deleteFailed=false;
      if (keyFile != null)       deleteFailed=keyFile.delete();
      if (!deleteFailed)       throw new IOException("String_Node_Str" + keyFile.getAbsolutePath());
      if (item != null)       item.delete();
    }
  }
;
}