#vulnerable code 
                             public long getTotal() {
		if (totalMemory == 0) {
			Scanner in = null;
			try {
				in = new Scanner(new FileReader("/proc/meminfo"));
			} catch (FileNotFoundException e) {
				totalMemory = 0;
				return totalMemory;
			}
			in.useDelimiter("\n");
			while (in.hasNext()) {
				String checkLine = in.next();
				if (checkLine.startsWith("MemTotal:")) {
					String[] memorySplit = checkLine.split("\\s+");
					totalMemory = parseMeminfo(memorySplit);
					break;
				}
			}
			in.close();
		}
		return totalMemory;
	} 
                            #location 19 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                             public long getTotal() {
		if (totalMemory == 0) {
			Sysinfo info = new Sysinfo();
			if (0 != Libc.INSTANCE.sysinfo(info))
				throw new LastErrorException("Error code: "
						+ Native.getLastError());
			totalMemory = info.totalram.longValue() * info.mem_unit;
		}
		return totalMemory;
	}