#vulnerable code 
                             private String normalizePem(String data) {
		PEMParser pemParser = new PEMParser(new StringReader(data));
		PEMKeyPair pemKeyPair = null;
		try {
			pemKeyPair = (PEMKeyPair) pemParser.readObject();
			PrivateKeyInfo privateKeyInfo = pemKeyPair.getPrivateKeyInfo();

			StringWriter textWriter = new StringWriter();
			PemWriter pemWriter = new PemWriter(textWriter);
			PemObjectGenerator pemObjectGenerator = new MiscPEMGenerator(privateKeyInfo);

			pemWriter.writeObject(pemObjectGenerator);
			pemWriter.flush();
			return textWriter.toString();
		}
		catch (IOException e) {
			throw new RuntimeException(e.getMessage(), e);
		}
	} 
                            #location 5 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                             private String normalizePem(String data) {
		PEMKeyPair pemKeyPair = null;
		try (PEMParser pemParser = new PEMParser(new StringReader(data))) {
			pemKeyPair = (PEMKeyPair) pemParser.readObject();
			PrivateKeyInfo privateKeyInfo = pemKeyPair.getPrivateKeyInfo();

			StringWriter textWriter = new StringWriter();
			try (PemWriter pemWriter = new PemWriter(textWriter)) {
				PemObjectGenerator pemObjectGenerator = new MiscPEMGenerator(
						privateKeyInfo);

				pemWriter.writeObject(pemObjectGenerator);
				pemWriter.flush();
				return textWriter.toString();
			}
		}
		catch (IOException e) {
			throw new RuntimeException(e.getMessage(), e);
		}
	}