Program: 94033
Project: 94033
Buggy source:
public static void adduser(String player,String email,String password,String ipAddress) throws SQLException {
  PreparedStatement ps;
  if (Config.custom_encryption != null) {
    try {
      password=Encryption.encrypt(Config.custom_encryption,password);
    }
 catch (    NoSuchAlgorithmException e) {
      Util.logging.StackTrace(e.getStackTrace(),Thread.currentThread().getStackTrace()[1].getMethodName(),Thread.currentThread().getStackTrace()[1].getLineNumber(),Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getFileName());
    }
catch (    UnsupportedEncodingException e) {
      Util.logging.StackTrace(e.getStackTrace(),Thread.currentThread().getStackTrace()[1].getMethodName(),Thread.currentThread().getStackTrace()[1].getLineNumber(),Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getFileName());
    }
  }
  if (Config.custom_emailfield == null || Config.custom_emailfield == "String_Node_Str") {
    ps=MySQL.mysql.prepareStatement("String_Node_Str" + Config.custom_table + "String_Node_Str"+ Config.custom_userfield+ "String_Node_Str"+ Config.custom_passfield+ "String_Node_Str",1);
    ps.setString(1,player);
    ps.setString(2,password);
    ps.executeUpdate();
    ps.close();
  }
 else   if (Config.custom_emailfield != null && Config.custom_emailfield != "String_Node_Str") {
    ps=MySQL.mysql.prepareStatement("String_Node_Str" + Config.custom_table + "String_Node_Str"+ Config.custom_userfield+ "String_Node_Str"+ Config.custom_passfield+ "String_Node_Str"+ Config.custom_emailfield+ "String_Node_Str",1);
    ps.setString(1,player);
    ps.setString(2,password);
    ps.setString(3,email);
    ps.executeUpdate();
    ps.close();
  }
}

Fixed version (ground truth):
public static void adduser(String player,String email,String password,String ipAddress) throws SQLException {
  if (!Config.database_keepalive) {
    Util.databaseManager.connect();
  }
  PreparedStatement ps;
  if (Config.custom_encryption != null) {
    try {
      password=Encryption.encrypt(Config.custom_encryption,password);
    }
 catch (    NoSuchAlgorithmException e) {
      Util.logging.StackTrace(e.getStackTrace(),Thread.currentThread().getStackTrace()[1].getMethodName(),Thread.currentThread().getStackTrace()[1].getLineNumber(),Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getFileName());
    }
catch (    UnsupportedEncodingException e) {
      Util.logging.StackTrace(e.getStackTrace(),Thread.currentThread().getStackTrace()[1].getMethodName(),Thread.currentThread().getStackTrace()[1].getLineNumber(),Thread.currentThread().getStackTrace()[1].getClassName(),Thread.currentThread().getStackTrace()[1].getFileName());
    }
  }
  String query;
  if (Config.custom_emailrequired) {
    query="String_Node_Str" + Config.custom_table + "String_Node_Str"+ Config.custom_userfield+ "String_Node_Str"+ Config.custom_passfield+ "String_Node_Str"+ Config.custom_emailfield+ "String_Node_Str"+ player+ "String_Node_Str"+ password+ "String_Node_Str"+ email+ "String_Node_Str";
    Util.logging.mySQL(query);
    ps=MySQL.mysql.prepareStatement("String_Node_Str" + Config.custom_table + "String_Node_Str"+ Config.custom_userfield+ "String_Node_Str"+ Config.custom_passfield+ "String_Node_Str"+ Config.custom_emailfield+ "String_Node_Str",1);
    ps.setString(1,player);
    ps.setString(2,password);
    ps.setString(3,email);
    ps.executeUpdate();
    ps.close();
  }
 else {
    query="String_Node_Str" + Config.custom_table + "String_Node_Str"+ Config.custom_userfield+ "String_Node_Str"+ Config.custom_passfield+ "String_Node_Str"+ player+ "String_Node_Str"+ password+ "String_Node_Str";
    Util.logging.mySQL(query);
    ps=MySQL.mysql.prepareStatement("String_Node_Str" + Config.custom_table + "String_Node_Str"+ Config.custom_userfield+ "String_Node_Str"+ Config.custom_passfield+ "String_Node_Str",1);
    ps.setString(1,player);
    ps.setString(2,password);
    ps.executeUpdate();
    ps.close();
  }
  if (!Config.database_keepalive) {
    Util.databaseManager.close();
  }
}