Close file in memory.cpp
This commit is contained in:
parent
22d9f6bd88
commit
7b0e2763ff
@ -25,6 +25,8 @@ bool memory::getProcMem(crow::json::wvalue& ret){
|
||||
|
||||
ret[line.substr(0,colon)] = std::stof(line.substr(last_space, final_space - last_space));
|
||||
}
|
||||
|
||||
f.close();
|
||||
} else {
|
||||
ret["message"] = "Failed to open proc filesystem";
|
||||
return false;
|
||||
@ -41,6 +43,7 @@ bool memory::getRawProcMem(std::string& ret){
|
||||
ret += line;
|
||||
ret += "\n";
|
||||
}
|
||||
f.close();
|
||||
} else {
|
||||
ret = "Failed to open proc filesystem";
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user