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));
|
ret[line.substr(0,colon)] = std::stof(line.substr(last_space, final_space - last_space));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
f.close();
|
||||||
} else {
|
} else {
|
||||||
ret["message"] = "Failed to open proc filesystem";
|
ret["message"] = "Failed to open proc filesystem";
|
||||||
return false;
|
return false;
|
||||||
@ -41,6 +43,7 @@ bool memory::getRawProcMem(std::string& ret){
|
|||||||
ret += line;
|
ret += line;
|
||||||
ret += "\n";
|
ret += "\n";
|
||||||
}
|
}
|
||||||
|
f.close();
|
||||||
} else {
|
} else {
|
||||||
ret = "Failed to open proc filesystem";
|
ret = "Failed to open proc filesystem";
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user