#fixed code
                             public <T> String serialize(T o) throws TransformationException, IOException {
		StringWriter sw = new StringWriter();
		ObjectWriter writer = createWriter(sw);
		if (o == null)
			nullConverter.serialize(null, writer, null);
		else
			serialize(o, o.getClass(), writer, new Context(this));
		writer.flush();
		return sw.toString();
	}
#vulnerable code 
                             public <T> String serialize(T o) throws TransformationException, IOException {
		JsonWriter writer = new JsonWriter(new StringWriter(), skipNull, htmlSafe);
		if (o == null)
			nullConverter.serialize(null, writer, null);
		else
			serialize(o, o.getClass(), writer, new Context(this));
		writer.flush();
		return writer.unwrap().toString();
	} 
                            #location 8 
                            #vulnerability type RESOURCE_LEAK